Menu

#134 glLight behaves in strange ways

open
nobody
GL (74)
5
2005-05-07
2005-05-07
Laxori666
No

I wanted to place a light at a certain position, namely
(0, 1, -6). I tried doing it this way:
glLightfv(GL_LIGHT0, GL_POSITION, [0, 1, -6])
and also this way:
glLightfv(GL_LIGHT0, GL_POSITION, [0, 1, -6, 0])
and I did not get the result I wanted (the light wasn't
where it was supposed to be).

After some fiddling, I ended up with code like this:
lightpos = [0, 1, -6]
glLightfv(GL_LIGHT0, GL_POSITION, lightpos)
This code produced the desired results. Considering I
changed nothing except the fact that I put the same
exact list in a variable before calling the function,
it seems to me that this is a bug. Or am I simply
getting something confused?

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.