Skip to main content
gamedev.net
🔒 Locked

Problems with Normals

Started by BlackScar Apr 13, 2000 at 11:32 PM 0 replies 600+ views
Original Post
BlackScar
BlackScar
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
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
WitchLord
WitchLord
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


0 -> 1 -> 3 -> 2

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.