# glVertexPointer question

Does glVertexPointer take the same vertex array as Direct 3d?

For example, in direct 3d, to make a cube, I would use these vertices:

Vertex count: 36
-1.00000000 -1.00000000 -1.00000000
1.00000000 -1.00000000 -1.00000000
1.00000000 -1.00000000 1.00000000
1.00000000 -1.00000000 -1.00000000
1.00000000 -1.00000000 1.00000000
-1.00000000 -1.00000000 1.00000000
-1.00000000 -1.00000000 1.00000000
-1.00000000 1.00000000 1.00000000
-1.00000000 1.00000000 -1.00000000
-1.00000000 1.00000000 1.00000000
-1.00000000 1.00000000 -1.00000000
-1.00000000 -1.00000000 -1.00000000
-1.00000000 -1.00000000 1.00000000
1.00000000 -1.00000000 1.00000000
1.00000000 1.00000000 1.00000000
1.00000000 -1.00000000 1.00000000
1.00000000 1.00000000 1.00000000
-1.00000000 1.00000000 1.00000000
-1.00000000 1.00000000 -1.00000000
1.00000000 1.00000000 -1.00000000
1.00000000 -1.00000000 -1.00000000
1.00000000 1.00000000 -1.00000000
1.00000000 -1.00000000 -1.00000000
-1.00000000 -1.00000000 -1.00000000
-1.00000000 1.00000000 1.00000000
1.00000000 1.00000000 1.00000000
1.00000000 1.00000000 -1.00000000
1.00000000 1.00000000 1.00000000
1.00000000 1.00000000 -1.00000000
-1.00000000 1.00000000 -1.00000000
1.00000000 -1.00000000 -1.00000000
1.00000000 1.00000000 -1.00000000
1.00000000 1.00000000 1.00000000
1.00000000 1.00000000 -1.00000000
1.00000000 1.00000000 1.00000000
1.00000000 -1.00000000 1.00000000

Is that what I would also use for glVertexPointer to make a cube?

hi,

the answer ist mostly yesss …
but the pointer may take every structure you define.
so it CAN be that structure … but does not need to be.

cu
uwi

I think I figured it out. in opengl, it seems that you can define the vertices in one array, then define an index array which describes your triangles. Brillaint! glVertexPointer() uses the vertices array and glDrawElements() uses the index array to draw the triangles. I like that more than the other way I mentioned above.