Making a lamp/spotlight

Hi, I’ve got an object that i would like to be a light source. I cant just set it’s position and use it as a GL_LIGHT cause this light is going to be moved. (Think the luxo lamp of pixar…)

How do I do this?

I’ve got this lightbulb inside the lamp all set up. It’s got an emission level of 1, 1, 1 and it’s definitely glowing… but it’s not projecting a light…

The lamp goes through many nested transformations before it reaches it’s final destination and that can change based on user input all the time…

Ok, now I’m just blabbing…

help!! :slight_smile:


Check the Red-Book. By the way, I havn’t worked with OGL lightnig for a while, but as far as I remember emmision just lightens current object glMaterialorsnthn without affecting the entire scene, so it’s the last thing you should use. You CAN change light position every frame, but that involved somthing like glLoadIdentity + matrix state changes, can’t say you for sure.

is right about the GL_EMMISSION property just affecting the material properties. It won’t actually act as a light that lights other things in the scene. But, if you set your light position in the same place in code as you set the “lamp” object, it should go through the same transformations and end up positioned in the appropriate spot.