Hi Sebas,

If you do want the result of the camera manipulator simply don't
attach one to your viewer and then just set the Camera's ViewMatrix on
each frame. i.e.

 osgViewer viewer;
 viewer.setSceneData(osgDB::readNodeFile("cow.osg"));
 viewer.realize();
 while(!viewer.done());
 {
    viewer.setViewMatrix(myViewMatrix);
    viewer.frame();
 }

Robert.

On 3 January 2012 12:42, Sebas Walther <sebas.walt...@googlemail.com> wrote:
> Hi,
>
> I am trying to write a plugin for an osg-based application with an 
> TrackballManipultor for the camera. It is no problem to get und set the 
> camera's viewmatrix of the main application if I do not use a camera 
> manipulator like the TrackballManipulator. But how is it possible to change 
> the viewmatrix every frame WITH an attached camera manipulator?
> I was wondering if this is possible without writing an own camera 
> manipulator. My idea is to change the viewmatrix AFTER the camera manipulator 
> sets the viewmatrix, so that my changed viewmatrix is used for rendering 
> instead of the viewMatrix the camera manipulator sets. Therefore I tried to 
> attach callbacks to the camera. Problem is I am not sure which callback I 
> have to use. I already tried an initialDrawCallback and an updateCallback. 
> Both callbacks are called and they also change the viewMatrix but the 
> cameraManipulator seems to overwrite the viewMatrix every frame. The 
> callbacks are attached to the camera with the methods setUpdateCallback() or 
> setInitialDrawCallback.
>
> Code:
> ...->getViewerCamera()->setUpdateCallback(new MyNodeCallback());
> ...->getViewerCamera()->setInitilDrawCallback(new MyInitialDrawCallback());
>
>
>
> I am sure that my callbacks are working. Did I try the wrong callbacks? Which 
> callback is the right one for my purpose?
>
> Thank you very much!
> Cheers,
> Sebas
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=44542#44542
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to