Results 1 to 3 of 3

Thread: lighting question

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Posts
    14

    lighting question

    hey i would like to make a light that resembles the sun but i want it stationary and always to shine in the exact same spot no matter where i i move the camera. the way i have it now everytime i change viewpoints the light shines in a different spot or if i dont use a spot light it rotates around the object im currently looking at. any ideas of how to stop this and make it point at the same place everytime? thanks

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: lighting question

    Looks like you are setting your lightposition before you set your modelview matrix (cameraposition). Try set lightposition AFTER you set modelview matrix.

    Not only vertices is multiplied by the current modelview matrix, but also the lightposition. If you set lightposition before cameraposition, the light will end up in the position you specify relative to the camera (<0,0,0> is where the camera is placed).

  3. #3
    Guest

    Re: lighting question

    THANK YOU, THANK YOU, THANK YOU !!!
    YOU SOLVED A PROBLEM THAT WAS TURNING ME CRAZY FOR ONE WEEK!!

Similar Threads

  1. lighting question
    By alanr in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-18-2011, 01:36 AM
  2. Question about lighting
    By anuchka in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-29-2004, 09:39 PM
  3. lighting question
    By HamsterofDeath in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 01-31-2003, 06:19 AM
  4. lighting question
    By schwinn in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-01-2002, 01:43 PM
  5. Lighting Question
    By Siwko in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 07-24-2000, 10:41 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