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 3 of 3

Thread: calculating normals for lighting

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    aulnay, france
    Posts
    20

    calculating normals for lighting

    hello

    i want to light a shape, for example a cone, composed by several polygons.
    i have (almost) no problems for calculating the normals of the curve part of the cone : at each vertex, i calculate its normal by averaging the adjoining facets normals.
    but if i do the same with the the plane part of the cone,
    i have a non-realistic effect.
    on the other hand, if i define a normal for each facets, i loose the smooth aspect.

    what can i do ?

    thanks ; )
    phanie

  2. #2
    Intern Newbie
    Join Date
    May 2001
    Posts
    41

    Re: calculating normals for lighting

    For the plane or base of the cone the normals pointing to negative y axis (if the sharp part is pointing to positive y axis), the normals on the edge too, no averaging with the rounded part.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: calculating normals for lighting

    Basically, you're going to have two sets of normals for the points around the flat parts. One set of normals will be used with the round part, the other set will be used with the flat part.

    This means that you will have to replicate the vertex position in your vertex array (if you are using one, that is).

Posting Permissions

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