Re: [osg-users] how do I make the light always hit the front of the camera?

2021-03-10 Thread Robert Osfield
If you want a light positioned relative to View's Camera then this is what the OSG provides by default. You can probably just remove the LightSource from the scene graph and rely upon it's settings. In include/osg/View you'll find: /** Options for controlling the global lighting used for

Re: [osg-users] how do I make the light always hit the front of the camera?

2021-03-09 Thread newli...@gmail.com
Hi, Robert . First of all, thank you for your interest and answer. I'm rendering using osg::Light and osg::LightSource with a spotlight pointing down. The exact position is set using light->setPosition() The direction of the light is set with the code below. osg::vec3d world =world +

Re: [osg-users] how do I make the light always hit the front of the camera?

2021-03-09 Thread Robert Osfield
Hi ? You don't say how you are rendering your present lights so providing guidance on how to adjust it isn't possible, you'll need to provide more information about your render system and what it relies upon for controlling the position and direction of the light. Also it's hard to understand