Inversed Lighting?
i''m having troubles with my lighting... it seems backwards or something, hehe
i got to apologize for my filthy code, there''s lot of crap in there that i played with earlier and didn''t remove... so some of the code ain''t even used.
Just keep your eyes on the lighting part and i hope that you''ll be fine.
my code is located here: http://www16.brinkster.com/simonsorcerer/files/thing.zip
someone please take a look.
Note: i havn''t followed the NeHe tutorials, so i''m not programming "NeHe-style", i''m using a book called "Computer Graphics Using OpenGL"
Tjenixen simon, overlord here.
Found the problem
in void myDisplay(void) change
glTranslated(myLightPosition[0],myLightPosition[1],myLightPosition[2]);//Light Position
to
glTranslated(-myLightPosition[0],-myLightPosition[1],-myLightPosition[2]);//Light Position
It's simple, if you want to move something to the left you translate ro the right.
See ya in september.
ps. att det krävs en grafiker att lösa ditt problem, skäms.
[edited by - lc_overlord on July 28, 2003 4:49:16 PM]
Found the problem
in void myDisplay(void) change
glTranslated(myLightPosition[0],myLightPosition[1],myLightPosition[2]);//Light Position
to
glTranslated(-myLightPosition[0],-myLightPosition[1],-myLightPosition[2]);//Light Position
It's simple, if you want to move something to the left you translate ro the right.
See ya in september.
ps. att det krävs en grafiker att lösa ditt problem, skäms.
[edited by - lc_overlord on July 28, 2003 4:49:16 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement