Infact it is what i''m trying to do. As you can see below, i''m trying to build a 256x256 grid, but when i run the code i get only a blank screen, and i can''t see where is the error.
float vertices[2*256*3];
int p;
glLoadIdentity();
glRotatef( tilt, 1.0, 0.0, 0.0 );
glRotatef( heading, 0.0, -1.0, 0.0 );
glTranslatef( xpos, ypos, zpos );
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,0,vertices);
for ( y=0; y<256; y++)
{
for ( x = 0; x<256; x++)
{
p=0;
vertices[p++]=x;
vertices[p++]=(y+1);
vertices[p++]=3;
vertices[p++]=x;
vertices[p++]=y;
vertices[p++]=3;
glColor3f(1,1,1);
glDrawArrays(GL_TRIANGLE_STRIP, 0, p/3);
}
glEnd();
}
glHorizon_Project
www.web-discovery.net