Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Gammastrahler

lighting works not properly

This topic is 5976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i have a scene with some buildings, where you can move from the first person view (like doom, etc), the geometry is illuminated by one light source. the position for that light is { 0.0f, 100.0f, -45.0f, 0.0f }; but there is something wrong; when i walk, the light "moves" relative to the camera, and when i look up the light on some buildings fades in and out. i have tried anything, setting the light pos before transformation, setting it after, or setting it not at all, even i tried it with directional lights. i dont use shininess or specular, and no spotlights. i only use the diffuse and ambient properties. i have checked my normals, they are all correct. what´s wrong here can you give me a hint? thanks, christian

Share this post


Link to post
Share on other sites
Advertisement
Take this with a grain of salt because I'm not actually very good with 3D. If I understand the problem correctly, you need to move the light yourself. Meaning this: If you have the light in front of you and you are moving forward or towards the light, it should eventually be behind you right? Well, obviously it doesn't seem to be doing this. My guess is that as you move "forward" it has to be moved backward in relation to your movement. This is the best help I can offer and seeing as how nobody has responded except me it's the best help you've gotten so far ;-)


-------------------
"Pointer?????"
-Anonymous

-=Xelius=-

Edited by - xelius on January 14, 2002 12:24:23 PM

Share this post


Link to post
Share on other sites
thanks, but i have tried it already, the light moves as well as my other objects around the camera, so it should be right.

but in either case, it does not.

Share this post


Link to post
Share on other sites
the solution is quite simple

every frame reset the cam,era postion

eg...

glLightfv(GL_LIGHT1, GL_POSITION, LightPosition);

after you''ve reset the scene

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!