PDA

View Full Version : light position and transformations



Neonic
02-15-2009, 09:05 AM
Hello, I have a question:

Imagine I would draw a cube in my scene, with lighting enabled. However, before I draw I do a translation on the modelview matrix.

This translation moves the cube, but will it also move the light in the scene? Will the translation affect lighting?

-Ekh-
02-15-2009, 10:48 AM
It depends, if you translate before calling the light functions, it will affect the light. But if you translate after calling light functions, then it won't.

Neonic
02-15-2009, 11:52 AM
That's all I needed to know. Thanks!