Author Topic: Need help from an OpenGL expert !  (Read 12108 times)

0 Members and 1 Guest are viewing this topic.

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 672
  • User-Rate: +27/-1
    • Charles Pegge
Re: Need help from an OpenGL expert !
« Reply #15 on: July 13, 2010, 08:41:52 PM »
Light is wholly dependent on normals. When Lighting is active the illumination of a surface is proportional to the cosine of the angle between the normal and the direction of the light source (roughly speaking). I you ceate you own objects then specifiying the GLNormal per vertex is essential. Manipulating the normals also allows you to fake smooth surfaces.

I have not used GLU shapes but I am sure they all come with their own set of normals.

For solar system lighting the light source should be placed in the same position as the Sun - and be under the same geometric transforms. Then when the sun moves so will the light. The planets to receive this illumination should come after the solar light source is defined and activated.

I hope this gives you a few clues.

Charles
« Last Edit: July 14, 2010, 04:20:23 PM by Charles Pegge »