Thanks. Setting the camera after the updateTraversal works great for my initial test, which is using the camera from my main view, but when I try to update the camera position for my RTT camera, the resulting texture does not get updated. Do I have to handle these to cameras differently?

CD

On 2014-03-18 03:37, Robert Osfield wrote:
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 [1]



Links:
------
[1] 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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to