Advertisement

Vertex Array question

Started by April 24, 2003 04:22 AM
1 comment, last by venomelektro 21 years, 10 months ago
Hi, I try to use VA in my code but I didn''t succeed , Here s my code :



static float carray[72]={
-1.0f, -1.0f,  1.0f,
 1.0f, -1.0f,  1.0f,
 1.0f,  1.0f,  1.0f,
-1.0f,  1.0f,  1.0f,

-1.0f, -1.0f, -1.0f,
-1.0f,  1.0f, -1.0f,
 1.0f,  1.0f, -1.0f,
 1.0f, -1.0f, -1.0f,

-1.0f,  1.0f, -1.0f,
-1.0f,  1.0f,  1.0f,
 1.0f,  1.0f,  1.0f,
 1.0f,  1.0f, -1.0f,

-1.0f, -1.0f, -1.0f,
 1.0f, -1.0f, -1.0f,
 1.0f, -1.0f,  1.0f,
-1.0f, -1.0f,  1.0f,

 1.0f, -1.0f, -1.0f,
 1.0f,  1.0f, -1.0f,
 1.0f,  1.0f,  1.0f,
 1.0f, -1.0f,  1.0f,

-1.0f, -1.0f, -1.0f,
-1.0f, -1.0f,  1.0f,
-1.0f,  1.0f,  1.0f,	
-1.0f,  1.0f, -1.0f};


 
Rendering :


glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(4,GL_FLOAT,0,carray);
glDrawArrays( GL_QUADS,0,72);


 
glVertexPointer( 3 ,GL_FLOAT, 0, carray); (3 not 4)
...read gl command documentation...

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Advertisement
oops ...


thanx

This topic is closed to new replies.

Advertisement