| |
|
|
 Andreas Gaida | Hi! Posesiones una Problema con glDrawArrays Befehl irgendwie bekomme Yo ihm seit vielen Tagen y Internet búsqueda no así para trabajo como lo se. Posesiones ya pocos Dutzend Varationen intenta sin erfolg tal vez sehe Yo sólo el Wald antes Lauter Bäumen no Yo wäre muy dankbar para Ayuda en el Problema.
Mfg Andreas KompilierenMarcaSeparaciónBeispielcode des Problem :
Declare Dateiname$,Datei$,ab$,rückgabe&,ende%,byt_count&
Declare vertex_P#,vertex_N#,vertex_T#,vertex_F3#,vertex_F4#,quad_A#
Declare zähler_P&,zähler_N&,zähler_T&,zähler_F&,zähler_F3&,zähler_F4&
daten_init Initialisiert Bereiche und füllt sie mit Daten
cls
oGL(Init, %hWnd, 0, 0, 0, 1)
@Set(oGLDepth, 1000)
oGL(glEnableClientState,~GL_VERTEX_ARRAY)
print oGL(glIsEnabled,~GL_VERTEX_ARRAY)
oGL(glVertexPointer,3,~GL_FLOAT,0,@Addr(quad_A#))
setTimer 20 max. 50 Frames /sek.
WhileNot ende%
WaitInput
DrawGLScene
EndWhile
ende_init
proc DrawGLScene
oGL(Clear)
oGL(Move, 0,0, -4)
quad wenn aktiviert zeigt Quadrat an wie es aussehen soll
oGL(glDrawArrays,~GL_QUADS, 0, 12) soll Quadrat zeichnen aus einen Bereich heraus
oGL(Show)
endproc
proc quad
rückgabe& =oGL(glBegin,~GL_QUADS)
oGL(glVertex3f,@Float(quad_A#, 0),@Float(quad_A#, 8),@Float(quad_A#, 16))
oGL(glVertex3f,@Float(quad_A#, 24),@Float(quad_A#, 32),@Float(quad_A#, 40))
oGL(glVertex3f,@Float(quad_A#, 48),@Float(quad_A#, 56),@Float(quad_A#, 64))
oGL(glVertex3f,@Float(quad_A#, 72),@Float(quad_A#, 80),@Float(quad_A#, 88))
rückgabe& = oGL(glEnd)
endproc
proc daten_init
Dim vertex_P# ,24000000
Dim vertex_N# ,24000000
Dim vertex_T# ,16000000
Dim vertex_F3#,12000000
Dim vertex_F4#,12000000
Dim quad_A# ,12000000
byt_count& = 0 Wenn 4 Zeigt glDrawArrays was an aber nicht das was es soll
Float quad_A#, (0 +byt_count&) = 0.0
Float quad_A#, (8 +byt_count&) = 1.0
Float quad_A#, (16+byt_count&) = 1.0
Float quad_A#, (24+byt_count&) = 0.0
Float quad_A#, (32+byt_count&) = 0.0
Float quad_A#, (40+byt_count&) = 1.0
Float quad_A#, (48+byt_count&) = 1.0
Float quad_A#, (56+byt_count&) = 0.0
Float quad_A#, (64+byt_count&) = 1.0
Float quad_A#, (72+byt_count&) = 1.0
Float quad_A#, (80+byt_count&) = 1.0
Float quad_A#, (88+byt_count&) = 1.0
endproc
proc ende_init
Dispose vertex_P#
Dispose vertex_N#
Dispose vertex_T#
Dispose vertex_F3#
Dispose vertex_F4#
Dispose quad_A#
ass=s4 href='./../../function-references/XProfan/ENDPROC/'>ENDPROC
Administratorische Anmerkung: Für Quellcodes Por favor, el CODE-Tag benutzen. |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 27.05.2007 ▲ |
|
|
|
|
 Frank Abbing | Como gehst du wohl falso antes. Como Yo verstanden habe, musst du dafür una Display-Liste benutzen:
[web]https://wiki.delphigl.com/index.php/Displaylisten[/web] Mit glNewList una neue Liste starten, esta füllen y luego con glCallList Mostrar. Roland ha aber Display-Listen instalado. Tal vez solltest du esta benutzen, anstatt selber welche por API nachzubauen. |
|
|
| |
|
|
|
 Andreas Gaida | Hi! glDrawArrays kann en Displaylisten vorkommen. Aber seine aufgabe es Vertex Daten de Arrays rápidamente de el Arbeitsspeicher a Dibujar. Z.B puede ser con una Aufruf 10000 Dreiecke en una vez Dibujar oder en un Displayliste einfügen Displaylisten voluntad en el Speicher el Grafikkarte y celebró son muy rápidamente aber desafortunadamente eignen ellos se sólo para Statische Objetos y Platz des Speichers es desafortunadamente begrenzt voluntad uno nun Animationen redactar braucht uno una schnelle Möglichkeit viele 3D Daten neu a Dibujar. esta Método: rückgabe& =oGL(glBegin,~GL_QUADS) oGL(glVertex3f,@Float(quad_A#, 0),@Float(quad_A#, 8),@Float(quad_A#, 16)) oGL(glVertex3f,@Float(quad_A#, 24),@Float(quad_A#, 32),@Float(quad_A#, 40)) oGL(glVertex3f,@Float(quad_A#, 48),@Float(quad_A#, 56),@Float(quad_A#, 64)) oGL(glVertex3f,@Float(quad_A#, 72),@Float(quad_A#, 80),@Float(quad_A#, 88)) rückgabe& = oGL(glEnd) es dafür simplemente a langsam ,glDrawArrays müste mindestens 10 veces así rápidamente ser si no todavía viel más rápido . Leider weis Yo no wieso el umsetzung el C Beispiele después de XProfan no Funktioniert
C Ejemplo : glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, vertex); glDrawArrays(GL_TRIANGLES, 0, 6);
Ganzer Queltext: [...] 
MfG Andreas |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 27.05.2007 ▲ |
|
|
|
|
 Andreas Gaida | Hi! Kann me tal vez alguien sagen como Daten des C Arrays en Xprofan bastante genau nachgebildet voluntad puede(necesario Byte genau el gleiche anordnung en el Speicher haben) oder welche Position cada Teile des C Arrays en una Zona einnehmen würden.
Für esta Informationen wäre Yo muy dankbar.
C Array : GLfloat vertex[4][3]={{-5.0f, 5.0f, 0.0f}, {-5.0f, -5.0f, 0.0f }, {5.0f, -5.0f, 0.0f }, {5.0f, 5.0f, 0.0f }};
MfG Andreas |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 29.05.2007 ▲ |
|
|
|
|
 | |
|
| |
|
|
|
 Andreas Gaida | THX
Auf esta Art Yo lo auch ya intenta
Dim quad_A# ,120000 byt_count& = 0 Float quad_A#, (0 +byt_count&) = 0.0 Float quad_A#, (8 +byt_count&) = 1.0 Float quad_A#, (16+byt_count&) = 1.0 Float quad_A#, (24+byt_count&) = 0.0 Float quad_A#, (32+byt_count&) = 0.0
habe no ahnung por qué el glDrawArrays Befehl no funktioniert habe mich bisher a el hoffnung geklammert el Yo el Array falso bestückt habe aber el es así wohl hinfällig.
MfG Andreas |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 30.05.2007 ▲ |
|
|
|
|
 | Mach veces una lauffähiges Minimalbeispiel - de el auch ersichtlich es como Usted el Array übergibst. Und Codes Por favor, siempre con KompilierenMarcaSeparación[/CODE] kennzeichnen! |
|
|
| |
|
|
|
 Andreas Gaida | Das erste Programa dieses Treads es el Ejemplo Programa en el Procedure daten_init voluntad el Array el zugehörigen Daten transferencia. El Procedure quad zeigt si ellos aktiviert se como ausehen debería. Leider klapt lo con el otro Método con glDrawArrays no el gleiche para dibujar . si yo el ersten Float wert des Arrays de 0.0 en 1.0 ändere características glDrawArrays algo pero no el richtige. con diesem Code se el Array el glDrawArrays Befehl a verfügung gestellt: KompilierenMarcaSeparación Bisher es No gelungen el Daten en el Array así anzulegen el Yo el gleiche ergebniss bekomme como con el quad Procedure.Obwohl Yo ya muy viele verschiedene anordnungen intenta habe weswegen Yo no weis si Yo como una Fehler mache oder el tal vez en Profano liegt . |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 30.05.2007 ▲ |
|
|
|
|
 | Probiere veces con Doubles en lugar de con Floats! |
|
|
| |
|
|
|
 | Apéndice Yo hatte hier warscheinlich en el OGL-Zona una OGL-Source Nuevo welcher después de diesem Principio una todo Szene características en el uno se auch puede moverse. Sogar con Spiegelung en el Boden etc - schau mal en el OGL-Zona después de Codes de me - tal vez hilfts. |
|
|
| |
|
|
|
 Andreas Gaida | Ok voluntad después de el Codes schauen viellen Dank
MfG Andreas |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 30.05.2007 ▲ |
|
|
|
|
 Andreas Gaida | Problema Gelöst Vielen Dank IF el Tip con el Doubles ha lo gebracht habe no gewust el el C float sólo 4 Bytes ha y ging de los XProfan 8 Bytes de el muste sí Murks geben
MfG Andreas |
|
|
| Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 31.05.2007 ▲ |
|
|
|