OpenGL Normal vector

Apr 14, 2012 at 9:43am
Hi.
I have a few questions about normals in OpenGL.
1. Should I put glNormal3f function before vertices declaration or after that? What's difference?
I mean:
1
2
3
4
5
glNormal3f(1, 1, 1);
glVertex3f(0, 0, 1);
glvertex3f(1, 0, 0);
glVertex3f(0, 1, 0);
// This is true, or I should put glNormal3f here? 

2. Is normal's polygon clock-wise or counter clock-wise? How about a vertex normal?

Thanks ;)
Apr 14, 2012 at 10:06am
I think glNormal3f normalises the vector you give it. That's the only difference it does. However; I don't see any relation between the vertices you're posing and the Normal you're talking about, so I don't really understand the first question here!!!!! If you have a wrapper like gl(quad...) then it doesn't matter I'd say.

And the normal is ALWAYS clockwise, i.e.; right-handed. That's what I learned in Vector Analysis in the unviersity ;)... I wouldn't think that OpenGL people would deliberately screw maths in their implementations!
Apr 14, 2012 at 10:22am
This site says you put gLNormal before the glVertex.

http://www.cse.msu.edu/~cse872/tutorial3.html

According to the site glNormal defines a vertex normal so if you want each vertex to have the same normal you define it once before all the glVertex.

If you want each vertex to have a different vertexnormal define glNormal before each glVertex.
Apr 14, 2012 at 11:30am
Thank you both ;)
Topic archived. No new replies allowed.