J'essai de faire une petite classe de test pour me familiariser avec JOGL et opengl.
Donc j'ai repris des petits bouts de codes un peu partout pour faire une demo avec un cube en rotation et ses 6 faces coloriées avec une couleur différente.
La demo fonctionne mais j'ai 3 gros bugs
Le premier quand j'utilise plus les fonctions gl.glColor3f(); et gl.glVertex3f();
mais que je passe par la creation de 2 tableaux de floats (color et vertex) puis que je passe les données dans des buffers et qu'enfin j'affiche avec le mécanisme de gl.glDrawArrays (GL.GL_QUADS, 0, 24). La machine virtuel de java crash de maniere aleatoire.
Le deuxieme "bug" , si j'utilise awt pour faire une Frame et GLCanvas , l'animation du cube est bcp bcp plus lente , je dirais 2 fois moins rapide qu'avec les composants swing JFrame et GLJPanel.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0b89ff11, pid=224, tid=1800 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode) # Problematic frame: # C 0x0b89ff11 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x0adaa800): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1800] siginfo: ExceptionCode=0xc0000005, reading address 0x0b9b2000 Registers: EAX=0x0c04485c, EBX=0x0b774180, ECX=0x00000000, EDX=0x00000008 ESP=0x0b19f210, EBP=0x3f800000, ESI=0x0b9b2000, EDI=0x00000000 EIP=0x0b89ff11, EFLAGS=0x00010206 Top of Stack: (sp=0x0b19f210) 0x0b19f210: 00000008 0b774180 00000000 0bd70f28 0x0b19f220: 697faf36 0b774180 0c044858 00000000 0x0b19f230: 00000008 0bd70480 00000000 00000007 0x0b19f240: 00000006 00000000 00000055 0b89fec0 0x0b19f250: 697fb020 00000007 00000000 00000008 0x0b19f260: 0b774180 695c2019 0b774180 00000007 0x0b19f270: 00000000 00000008 0adaa800 06e89f60 0x0b19f280: 02a54350 0b19f298 10003ff5 00000007 Instructions: (pc=0x0b89ff11) 0x0b89ff01: 08 8b 35 a0 04 78 0b 8b 76 64 8d 3c 49 8d 34 be 0x0b89ff11: 8b 3e 8b 6e 04 89 78 0c 89 68 10 8b 7e 08 89 78 Stack: [0x0b150000,0x0b1a0000), sp=0x0b19f210, free space=316k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C 0x0b89ff11 [error occurred during error reporting, step 120, id 0xc0000005] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J com.sun.opengl.impl.GLImpl.glDrawArrays(III)V J TestJOGL.display(Ljavax/media/opengl/GLAutoDrawable;)V J com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V J javax.media.opengl.GLJPanel$Updater.display(Ljavax/media/opengl/GLAutoDrawable;)V J com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V J com.sun.opengl.impl.GLPbufferImpl$DisplayAction.run()V J com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V J com.sun.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V J com.sun.opengl.impl.GLPbufferImpl.display()V J javax.media.opengl.GLJPanel.paintComponent(Ljava/awt/Graphics;)V J javax.swing.JComponent.paint(Ljava/awt/Graphics;)V J javax.swing.JComponent.paintToOffscreen(Ljava/awt/Graphics;IIIIII)V J javax.swing.BufferStrategyPaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)Z J javax.swing.RepaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)V J javax.swing.JComponent._paintImmediately(IIII)V J javax.swing.JComponent.paintImmediately(IIII)V J javax.swing.RepaintManager.paintDirtyRegions(Ljava/util/Map;)V J javax.swing.RepaintManager.paintDirtyRegions()V J com.sun.opengl.util.Animator$1.run()V J java.awt.event.InvocationEvent.dispatch()V J java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V J java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30 j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 j java.awt.EventDispatchThread.run()V+9 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x00386400 JavaThread "DestroyJavaVM" [_thread_blocked, id=2488] 0x0ade7000 JavaThread "Thread-2" [_thread_blocked, id=3492] =>0x0adaa800 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1800] 0x0ad9a000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2236] 0x0ad99400 JavaThread "AWT-Shutdown" [_thread_blocked, id=3228] 0x0aaed800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=1108] 0x0aa8b400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3924] 0x0aa88400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3660] 0x0aa85800 JavaThread "Attach Listener" daemon [_thread_blocked, id=3856] 0x0aa84800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3252] 0x0aa76800 JavaThread "Finalizer" daemon [_thread_blocked, id=184] 0x0aa72400 JavaThread "Reference Handler" daemon [_thread_blocked, id=3600] Other Threads: 0x0aa6f400 VMThread [id=1628] 0x0aa96000 WatcherThread [id=2424] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 295K [0x02960000, 0x02a60000, 0x02e40000) eden space 896K, 29% used [0x02960000, 0x029a31e0, 0x02a40000) from space 64K, 42% used [0x02a50000, 0x02a56d18, 0x02a60000) to space 64K, 0% used [0x02a40000, 0x02a40000, 0x02a50000) tenured generation total 4096K, used 2020K [0x02e40000, 0x03240000, 0x06960000) the space 4096K, 49% used [0x02e40000, 0x03039138, 0x03039200, 0x03240000) compacting perm gen total 12288K, used 8102K [0x06960000, 0x07560000, 0x0a960000) the space 12288K, 65% used [0x06960000, 0x07149a18, 0x07149c00, 0x07560000) No shared spaces configured. Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x7c910000 - 0x7c9c7000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c905000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x7e390000 - 0x7e420000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f37000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76ae0000 - 0x76b0f000 C:\WINDOWS\system32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76ba0000 - 0x76bab000 C:\WINDOWS\system32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x72f50000 - 0x72f76000 C:\WINDOWS\system32\WINSPOOL.DRV 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76320000 - 0x7633d000 C:\WINDOWS\system32\IMM32.dll 0x774a0000 - 0x775dd000 C:\WINDOWS\system32\ole32.dll 0x5b090000 - 0x5b0c8000 C:\WINDOWS\system32\uxtheme.dll 0x736b0000 - 0x736f9000 C:\WINDOWS\system32\ddraw.dll 0x73b10000 - 0x73b16000 C:\WINDOWS\system32\DCIMAN32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x74690000 - 0x746db000 C:\WINDOWS\system32\MSCTF.dll 0x7c9d0000 - 0x7d1f3000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x77390000 - 0x77493000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll 0x58b50000 - 0x58bea000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x1004d000 C:\Program Files\Java\jogl\jogl-1.1.0-pre-20070307-windows-i586\lib\jogl.dll 0x5f070000 - 0x5f13c000 C:\WINDOWS\system32\OPENGL32.dll 0x6cef0000 - 0x6cf11000 C:\WINDOWS\system32\GLU32.dll 0x69500000 - 0x69b7f000 C:\WINDOWS\system32\nvoglnt.dll VM Arguments: jvm_args: -Djava.library.path=C:\Program Files\Java\jogl\jogl-1.1.0-pre-20070307-windows-i586\lib;C:\Program Files\Java\jogl\jogl-1.1.0-pre-20070307-windows-i586\lib java_command: TestJOGL Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Fichiers communs\Autodesk Shared\;C:\Program Files\Autodesk\backburner\;C:\Program Files\Fichiers communs\Adobe\AGL;C:\Program Files\Java\jdk1.6.0_01\bin\;C:\Program Files\NVIDIA Corporation\Cg\bin;C:\Program Files\GnuWin32\bin USERNAME=Christophe OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht Memory: 4k page, physical 1047916k(342968k free), swap 2521736k(1886696k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310
Es ce normal car les composants awt sont plus "lourd" que ceux de swing ?
(j'utilise la version 1.6 de java et je suis sous windows)
Le troisième "bug" quand la demo ne plante pas au bout de quelques rotations un triangle d'une des faces du cube devient transparente.
Je vous met le code :
En esperant qu'une âme charitable est deja rencontré ce type de problème.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331 import java.awt.event.*; import javax.swing.*; import java.awt.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import com.sun.opengl.util.*; import java.nio.FloatBuffer; /* * Pour utiliser Opengl notre classe doit implémenter l'interface * GLEventListener. Cela va nous permettre d'utiliser les fonctionalités * d'OpenGl avec le JPanel. * L'interface oblige a redefinir 4 méthodes: * -- init() // Cette methode est appelée une fois ,elle va contenir l'initialisation * -- display() * // Cette methode sera appélé en boucle et contiendra * // toute la partie affichage * -- reshape() * // Cette methode est appelé quand il ya un redimensionnement de la fenêtre * // afin d'eviter un affichage diforme * -- displayChanged() */ public class TestJOGL implements GLEventListener { private float rotateT = 0.0f; private static final GLU glu = new GLU(); public static void main(String[] args) { /*Creation d'une fenetre * Utilisation d'un composant swing */ JFrame frame = new JFrame("Esssai de java openGl"); //Frame frame = new Frame("Esssai de java openGl"); /*Creation d'un paneau * Utilisation d'un composant swing plutot qu'awt(GLCanvas) * C'est le paneau sur lequel on dessine */ //GLJPanel panel = new GLJPanel(); GLCanvas panel = new GLCanvas(); /* On attache un "ecouteur" a la surface dessinable qui va capturer * les évenements de la classe TestJOGL */ panel.addGLEventListener(new TestJOGL()); /* * On ajoute le panneau a la fenetre * (layout par defaut (BorderLayout)) */ frame.add(panel); /*Creation de l'animator * Il va gérer l'appel en boucle de la méthode display(), * qui s'occupe de la creation de l'image * L'animator crée un thread dans lequel les appels a display() * sont effectués.Il va aussi se charger de faire * une pause entre chaque rafraichissement de l'image pour * permettre aux autres threads ou processus de s'executer. * On peut reduire la pause avec cette methode setRunAsFastAsPossible(true); * Il possède deux méthodes principales : start() et stop() * pour lancer et arreter l'animation. */ final Animator animator = new Animator(panel); /* * Bout de code habituel qui permet de fermer * la fenetre.Voir cours sur les api Graphiques */ frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { // Creation d'un thread que se charge d'arreter l'annimator // avant l'arret du programme new Thread(new Runnable(){ public void run() { animator.stop(); // stop l'affichage System.exit(0); // quite le programme } }).start(); } }); /* * Modifie la resolution de la fenetre */ frame.setSize(400, 400); /* *Rend la fenetre visible */ frame.setVisible(true); /* * Lance le thread qui se charge de l'affichage */ animator.start(); } /** * GLEventListener renvoie un contexte (drawable) * Qui va nous permettre d'instancier un objet * de type GL à partir du quel on utilisera * les fonctions OpenGL. * */ public void init(GLAutoDrawable drawable) { // Instanciation de l'objet GL final GL gl = drawable.getGL(); /* * Désactive la synchronisation verticale * indépendement de la plate forme utilisée */ gl.setSwapInterval(1); //gl.glShadeModel(GL.GL_SMOOTH); /* Methode qui etablit vers quel couleur la fenetre sera * vidé en l'occurence le blanc */ gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); /* * indique la valeur de profondeur (entre 0.0 et 1.0) * utilisée par glClear pour effacer le tampon de profondeur */ gl.glClearDepth(1.0f); gl.glEnable(GL.GL_DEPTH_TEST); gl.glDepthFunc(GL.GL_LEQUAL); //Tableau avec les coordonnées des sommets float vertices []= new float[] { 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f}; float couleurs []= new float[]{ 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.5f, 0.5f, 0.0f, 1.5f, 0.5f, 0.0f, 1.5f, 0.5f, 0.0f, 1.5f, 0.5f, 0.0f}; FloatBuffer verticesBuff = BufferUtil.newFloatBuffer(24*3); FloatBuffer couleursBuff = BufferUtil.newFloatBuffer(24*3); verticesBuff.put(vertices); couleursBuff.put(couleurs); verticesBuff.rewind(); couleursBuff.rewind(); gl.glEnableClientState(GL.GL_VERTEX_ARRAY); gl.glEnableClientState(GL.GL_COLOR_ARRAY); gl.glVertexPointer(3, GL.GL_FLOAT,0,verticesBuff); gl.glColorPointer(3, GL.GL_FLOAT,0,couleursBuff); } public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { final GL gl = drawable.getGL(); if(height <= 0) { height = 1; } final float h = (float)width / (float)height; gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(50.0f, h, 2.0, 1000.0); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); } public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); /* glClear() * efface les tampons à l'intérieur du "viewport * glClear prend un seul argument qui est * un masque de bits de plusieurs valeurs, * chacune indiquant un tampon à effacer. * * GL_COLOR_BUFFER_BIT ==> Indique les tampons de couleurs * actuellement utilisés en écriture. * * GL_DEPTH_BUFFER_BIT ==> Indique le tampon de profondeur */ gl.glClear(GL.GL_COLOR_BUFFER_BIT |GL.GL_DEPTH_BUFFER_BIT); // remplace la matrice courante par la matrice d'identité gl.glLoadIdentity(); /* *Déplace l'origine du système de coordonnées au point spécifié * La matrice courante est multipliée par cette matrice de translation * Si la matrice courante est soit GL_MODELVIEW soit GL_PROJECTION, tous * les objets dessinés après l'appel à glTranslate subissent * cette translation. */ gl.glTranslatef(0.0f, 0.0f, -5.0f); /* * calcule une matrice qui réalise la rotation d'angle degrés * dans le sens trigonométrique autour du vecteur (x, y, z). * Meme principe que glTranslate */ gl.glRotatef(300.0f, 250.0f, -155.0f, 115.0f); gl.glRotatef(rotateT, 1.0f, 0.0f, 0.0f); gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f); gl.glRotatef(rotateT, 0.0f, 0.0f, 1.0f); gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f); // La ligne magique gl.glDrawArrays (GL.GL_QUADS, 0, 24); /* * Force l'execution des commandes non encore achevées */ gl.glFlush (); rotateT += 0.2f; /* gl.glBegin(GL.GL_QUADS); gl.glColor3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 0.0f, 0.0f); gl.glColor3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(0.0f, 0.0f, 0.0f); gl.glColor3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, 0.0f, 0.0f); gl.glColor3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 0.0f, 1.0f); gl.glColor3f(1.5f, 0.5f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 1.0f, 1.0f); gl.glVertex3f(1.0f, 0.0f, 1.0f); gl.glVertex3f(0.0f, 0.0f, 1.0f); gl.glEnd();*/ } public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,boolean deviceChanged) { } }
Partager