Sure this code works... it''s not mine... :|
Anyway I think I know where my errors are, they are in the drawing of my quads... we must drawing them in counter clockwise, but IN RELATION to what ??? in a 3D world, anything is from a point of view, no?
I draw my quads that way:
bottom-left
bottom-right
top-right
top-left
point view: in front of the light face (the up face)
But that is not seems to works...
Is this the "good" connter clockwise ???
OpenGL normal newB question
quote:
Original post by TYBZ
I draw my quads that way:
bottom-left
bottom-right
top-right
top-left
point view: in front of the light face (the up face)
yep that's right. you are drawing them in the correct order. the reference point is from the up face.
lemme suggest something. don't bother with lighting until you have got some objects to sucessfully draw. just take out the line where you say: "glEnable(GL_LIGHTING);" and for safety's sake, comment out ALL lines that have anything to do with lighting.
get some things to draw
THEN worry about lighting.
otherwise you're debugging too many things to hope to succeed.
you don't need lighting enabled to be able to see things.
my guess is that either your draw code is wrong or you have all your normals pointing the wrong way.
anyway, turn off lighting and get your polys to draw. if you still have problems after you do that, post your draw method here and we can work through it.
-me
[edited by - Palidine on July 11, 2002 4:39:44 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement