Hi CD,
You could use an update callback but you'd need to make sure anything that
might move the Light will be done prior to the Camera's update callback.
Perhaps the easiest way to ensure this is to set the camera after the
Viewer::updateTraversal() but before the Viewer::renderingTraversals(); To
do this you'll need to create your own frame loop i.e.
while(!viewer.done())
{
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
// set the camera here.
viewer.renderingTraversals();
}
Robert.
On 17 March 2014 17:59, Conan <[email protected]> wrote:
> I want to update the position of one of the cameras in my app based on the
> position of a light. I am updating the light position via an update
> callback. What is the recommend way to update the camera position? From
> some of the OSG source code I have seen that it is possible to get the
> light, and it's position, during a cull callback, and then set the camera
> matrix this way. Is this the best way to accomplish this?
>
> CD
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org