Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  VertexArray  (Read 2001 times)
0 Members and 1 Guest are viewing this topic.
Offline TarmTarm

Senior Newbie




Write once, never run.


« Posted 2003-07-21 22:35:04 »

I'm stuck with VertexArrays, I can't get it to work. Cry Does anyone have a small working example (for jogl)? Tongue
Offline DavidYazel

Junior Devvie




Java games rock!


« Reply #1 - Posted 2003-07-21 22:58:18 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
  if (normals != null) {
                gl.glEnableClientState(gl.GL_NORMAL_ARRAY);
                gl.glNormalPointer(gl.GL_FLOAT, 0, normals);
            }

            if (vectors != null) {
                gl.glEnableClientState(gl.GL_VERTEX_ARRAY);
                gl.glVertexPointer(3, gl.GL_FLOAT, 0, vectors);
            }

            if (texCoords2D != null) {
                gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY);
                gl.glTexCoordPointer(2, gl.GL_FLOAT, 0, texCoords2D);
            }

            if (texCoords3D != null) {
                gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY);
                gl.glTexCoordPointer(3, gl.GL_FLOAT, 0, texCoords3D);
            }

            gl.glDrawArrays(mode, 0, numVertices);

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
8: Undefined index: online
File: /home/jgo/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 161