Results 1 to 4 of 4

Thread: static lighting

  1. #1
    Member Contributor
    Join Date
    Feb 2004
    Location
    Gainesville, Florida
    Posts
    51

    static lighting

    hello everyone,

    i'm a newbie in opengl and i've been working on it for sometime. I had a sort of wierd experience during lighting. you see i have a model at the origin and i have given two lights at opposite side of the object. now when i rotate the object by glRotatef(), i see that the lighting appears to be static.In other words, the lights seem to be attached to the model. instead shouldn't the light affect differently at different places of the object when i rotate the object. right now its like as though i am rotating the object together with the lights.

    I hope you guys understand what i mean. i want the object to rotate independant of the lighting.

    To be more precise, its like as if the texure were all precalculated with lighting and then applies to the 3d object. i want the object to be lit independant of the lights.

    thanx for your time

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    380

    Re: static lighting

    set you light position after transforming the modelview matrix

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    380

    Re: static lighting

    better idea, make sure you are using the modelview matrix not the projection matrix

  4. #4
    Member Contributor
    Join Date
    Feb 2004
    Location
    Gainesville, Florida
    Posts
    51

    Re: static lighting

    hi, thanx a lot. it worked fine.

Similar Threads

  1. shadow for static mesh and static lights
    By jide in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 05-03-2006, 06:19 PM
  2. Static... How do I get rid of it?
    By ceige in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 03-30-2004, 10:17 AM
  3. Static lighting in objects
    By Coluna in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-15-2003, 08:33 PM
  4. Static part, Please help
    By guju in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-05-2002, 12:53 AM
  5. Static Lighting
    By G4Soon in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-27-2001, 09:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean