PDA

View Full Version : have problem to calc normal to surface



lonibabi
06-13-2013, 03:21 PM
i use a guide in this site that explain how to calc normalized normal
i try to do that in my project and it not showing the light correctly

QUADS
glVertex3d( -3, -3, 0);//v1
glVertex3d( -3, 3, 0);//v2
glVertex3d (3, 3, 0);//i did'nt use this vertex only the three other
glVertex3d (3, -3, 0);//v3

in the and i get that the normalized normal = (0,0,1.002322884)

GClements
06-13-2013, 05:06 PM
The calculated normal is correct (other than some minor rounding error; it should be (0,0,1)) for a clockwise face. For a counter-clockwise face, it should be (0,0,-1). Reversing the order of the vertices will invert the normal.