Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Colors on terrain, glcolorpointer ?

  1. #11
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    354
    On a plane the normal is the vector perpendicular to the plane. Cause in openGL we send information on the vertex the normal vector is issued as vertex attribute, the normal of the point on the triangle is the (linear) interpolation of the normal on the vertexes.
    Normal is usually combined with light direction to shade the surface.

    Normal map for example is a technique that use a texture to disturb the surface normal by sampling another vector from a texture.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  2. #12
    Intern Newbie
    Join Date
    Apr 2012
    Posts
    45
    Quote Originally Posted by Rosario Leonardi View Post
    On a plane the normal is the vector perpendicular to the plane. Cause in openGL we send information on the vertex the normal vector is issued as vertex attribute, the normal of the point on the triangle is the (linear) interpolation of the normal on the vertexes.
    Normal is usually combined with light direction to shade the surface.

    Normal map for example is a technique that use a texture to disturb the surface normal by sampling another vector from a texture.
    so normals are used only for lights (?)

    nothing else ?

  3. #13
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,170
    Correct. Normals are used as part of the lighting equation.
    On a terrain, you could read the normal at ang given triangle and use that to work out the best postion to place vegetation, etc but this is more of a specialist use of 'normals'.

  4. #14
    Intern Newbie
    Join Date
    Apr 2012
    Posts
    45
    it's actually useful as you said. think of a train and rail system and their angle according to the normals :P

Posting Permissions

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