SDL & OpenGL
August 10, 2004 07:12 AM
Maybe the problem that u see nothing is that by default the front of a polygone is defined by setting the vertices counter clockwise
so your polys face away from the screen and are culled away...
either use glFrontFace(GL_CW) or change the order of vertices
e.g. to
// draw a triangle
glBegin(GL_POLYGON); // start drawing a polygon
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd(); // we're done with the polygon
so your polys face away from the screen and are culled away...
either use glFrontFace(GL_CW) or change the order of vertices
e.g. to
// draw a triangle
glBegin(GL_POLYGON); // start drawing a polygon
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd(); // we're done with the polygon
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement