View Full Version : Vertex Array

07-12-2000, 05:27 AM
Hi there...

its me again.... http://www.opengl.org/discussion_boards/ubb/smile.gif)

Can somebody can help ???
i've working through nehe tuts, SuperBible and others... i'm doing fine...
but i really can make something..
Draw a cube using a vertex array...

show me a sample source, ok ????



07-12-2000, 03:13 PM
This will render a 2 unit square in the XY plane. Put it where you do you're rendering and try it. You can look up the arguments to see what each do. This isn't a cube, but you shouldnt have a problem figuring out the rest. http://www.opengl.org/discussion_boards/ubb/smile.gif

GLdouble pts[] = {-1,1,0,1,1,0,1,-1,0,-1,-1,0};

glVertexPointer(3, GL_DOUBLE, 0, pts);
glDrawArrays(GL_LINE_LOOP, 0, 4);

02-14-2003, 05:15 AM
how to use glDrawElements ?

02-14-2003, 05:33 AM
If you go to my website, I did just what you want. I drew a cube using vertex arrays on my last OpenGL tutorial. I haven't donet he word file for it yet, but I have the code and the exe up.

Website link: http://umn.edu/~kesa0007

- Halcyon