PDA

View Full Version : Vertex Array



Blza
07-12-2000, 06: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 ????


THANS!!!!

[]'s

SED
07-12-2000, 04: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};

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

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

HalcyonBlaze
02-14-2003, 06: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