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: Lighting and scaling

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Ames,IA USA
    Posts
    2

    Lighting and scaling

    I am working on a 3d application that is using Lighting luminate the IGES, STL or STLB file that it loads in. However the lighting attenuation is not working correctly when I scale the 3d object to a larger size. I found out that the attenuation calculations believe that it is getting further and further away from the object when in reality it is not. So in a nutshell, my light and object are on 2 different coordinate planes and it is messing up the lighting calculations. Does anyone have any suggestions?

    Thanks

  2. #2
    Guest

    Re: Lighting and scaling

    It could be possible that u have not tessalated the facing polygons. As the lighting calculation are done only on vertices and not the entire polygon, and it interpolates the lighting over the polygon. As the vertices move away from the light source its intensity decreases not only due to attenuation (which u enabled) but also as normal and light vector angle increase.
    If this is the case then u can try tessalating the polygon, dividing it in no of triangle strips.

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Lighting and scaling

    You mentioned the magic word "scaling".
    If you scale an object with the modelview matrix you must enable GL_NORMALIZE to get the normals correct again.
    Check the OpenGL Programmers Guide appendix F, Transforming Normals.

Posting Permissions

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