Archived

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

Gammastrahler

lighting works not properly

Recommended Posts

Gammastrahler    150
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
Xelius    123
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
Marvin    127
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