[PyOpenGL-Users] Strange things happening with glLight
Brought to you by:
mcfletch
From: <lax...@ya...> - 2005-05-07 00:42:53
|
I want 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). Oh, this reminds me of another thing - what is that 4th value for with all the glLight calls? In three dimensions one has three coordinates. 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, I am very confused as to why the 2nd version worked and not the first. Can anyone help me out? - Claudiu Discover Yahoo! Find restaurants, movies, travel and more fun for the weekend. Check it out! http://discover.yahoo.com/weekend.html |