PCJohn wrote on 2010-03-19: 
> Hi Bryan,
>> osg::Light is a StateAttribute and osg::LightSource is a Group, so
> Light represents the OpenGL state (like the light ID) for a light in
> the scene, and LightSource represents the location of that light (note
> that LightSource has a Light).
>> 
> And why there is LightSource? What is meaning of it? I think, I can live
> just with osg::Light. And really, I used only osg::Light in my
> application. Is there any reason for me or anyone else to use
> osg::LightSource?

You place the LightSource in the scene graph where you want the light to be 
positioned. I don't think it is necessary for directional lights (they are 
infinitely far away, so don't have a position), but say you want a spotlight 
attached to a train locomotive. You could update osg::Light's position every 
time the locomotive moves, or you could attach a LightSource to the 
locomotive's scene graph and have the light placed correctly automatically.

HTH,
--
Bryan Thrall
FlightSafety International
[email protected]
  


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to