Problems with Normals
Hola!
When I try to render a four verticie object using the GL_TRIANGLE_STRIP and try to GL_CULL_FACE it, it doens''t work. It will display half of the surface but not the other half. Also, how do you activate this *glNormal3f(-1.0f, 0.0f, 0.0f)*? I thought this was suppose to be used to tell the direction the face is pointing. But when I try to use it it doesn''t affect a thing. What''s going on here?
;(
Justin Eslinger
The normal that you specify with glNormal3f() is only used for lighting not culling. When OpenGL checks to see if a triangle is facing the camera it does this by looking at the order of the vertices. A clockwise order gets culled and a counter clockwise order is shown, or vice versa depending on your settings.
I think that you only see half of your surface because you send the vertices in the wrong order. Try using GL_TRIANGLE_FAN instead or send them in this order:
0 -> 1 -> 3 -> 2
I think that you only see half of your surface because you send the vertices in the wrong order. Try using GL_TRIANGLE_FAN instead or send them in this order:
0 1 +-+ !/! +-+3 2
0 -> 1 -> 3 -> 2
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement