Jump to content

  • Log In with Google      Sign In   
  • Create Account

Point Light Source


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Jean-Luc Pikachu   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 January 2002 - 07:02 PM

Ok, I''m trying to create a small point light source, kinda like a fireball or a torch. I can figure out spotlights and ambient world lights, but I can''t do this for some reason. My idea was to create a light source, give it a position with a w coordinate of 1.0 making it a positional instead of directional source, right? I would give it a cutoff of 180 and a constant attenuation of maybe 3 or 4 so the light would only affect stuff in its immediate vicinity, maybe only 20 units away or something. I''m using a red colored light (setting the ambient, diffuse & specular properties of the light to be {1.0, 0.0, 0.0}). I end up with a light that appears to originating from the camera. I know, this got answered in that other thread, but over there that guy was trying to create a spotlight, I''m not, and I''m definitely putting my light positioning code after I set up the perspective stuff (which is only called once). Is what I''m describing possible? If so, any idea what I''m doing wrong? -- Peace, Capt. Jean-Luc Pikachu

Sponsor:

#2 python_regious   Members   -  Reputation: 929

Like
Likes
Like

Posted 04 January 2002 - 11:31 PM

If you were talking about my thread, I wasn''t trying to create a spotlight, but rather a general directional light to light a terrain ( I know, lightmaps are better - but I''m pacing myself ).

My problem came from only setting the light position once, in the initcode, like yourself. It needs to be set after you translate to the current scene position ( via gluLookAt or manually using glLoadMatrix or the rotates/translates ). You will also probably need to push/pop the modelview matrix, as answered in the other thread also.

Thats what solved my problem, and it may solve yours too!

#3 Jean-Luc Pikachu   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 January 2002 - 08:54 AM

On the one hand, I now understand alot more about lighting position than before, thanks. On the other hand, my problem has not been solved. I will experiment further and get back to ya''ll.

--
Peace,
Capt. Jean-Luc Pikachu





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS