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


Inversed Lighting?

Recommended Posts

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: 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"

Share this post

Link to post
Share on other sites
Tjenixen simon, overlord here.

Found the problem
in void myDisplay(void) change
glTranslated(myLightPosition[0],myLightPosition[1],myLightPosition[2]);//Light Position


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]

Share this post

Link to post
Share on other sites