Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: have problem to calc normal to surface

  1. #1
    Newbie Newbie
    Join Date
    Apr 2013

    have problem to calc normal to surface

    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

    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)

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2013
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts