Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Understanding glNormal

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    9

    Understanding glNormal

    Let's say that there's a vertex which is a part of a triangle, and part of a quad. To my best understanding, the normal of that vertex is the average of the normal of the quad and the normal of the triangle, right?
    Let's also assume that the triangle is drawn before the quad. When should I call glNormal and with what vector?
    Should I call glNormal 2 times, each time with the same vector (the average normal vector)?
    Or should I call glNormal the last time the vertex is drawn with the average normal vector?

  2. #2
    Junior Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Location
    Innsbruck, Austria
    Posts
    145
    Your vertices are discrete sample points of a complex surface. Normal vectors are set for each vertex. In your case, you have to set an apropriate normal vector before every glVertex call. What value you pass is arbitrary. For a simple rectangular area, you might want the normals to point into the same directions, namely the normal vector of the plane.

Posting Permissions

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