Advertisement

...and there was light...

Started by April 11, 2002 04:27 PM
3 comments, last by The Wizard Of Oz 22 years, 10 months ago
hi! i''m sure i''m not the first person with this kind of a problem... i''m creating a game with movement system taken from lesson 10, but when i add Diffuse light to my scene it illuminates only areas i''m currently moving through... it''s like i''ve got a flashlight in my hands... my question is: how can i make my diffuse light static...how can i make it stop following me, illuminating only center of my room? :? please help, i''m desperate thanx in advance follow the yellow brick road
follow the yellow brick road
easy, just do
glLightfv(GL_LIGHT0, GL_POSITION, LightPosition)
after you transform your modelview matix (ie after glTranslatef)
and it should work fine
subsititute whatever light# and LightPosition are appropriate
Advertisement
if my starting light position was for example 2,2,-2
should i put just use that light position , or should i decrease it by xtrans, ytrans and ztrans?

follow the yellow brick road
follow the yellow brick road
I think if you''re going to change the place of the light with the direction you move you get the same problem as you already had..

Correct me if I''m wrong
Treat your light just like any other 3d object, you place it in modelview w/ the glLightfv() func.

Whether it moves, and how it moves is another matter.

zin

zintel.com - 3d graphics & more or less
zintel.com - 3d graphics & more or less

This topic is closed to new replies.

Advertisement