Hi Axel,

You could use two routes, to subclass from osgGA::CameraManipuilator
(was named MatrixManipulator in 2.8.x) as per
TrackballlManipulator/DriverManipulataor/etc, or have your own event
handler set the View(er)'s Camera's ViewMatrix directly and not use a
CameraManipulator.

If you go the later route then you'll need to not assign a
CameraManipulator to the View(er), and not call the convinience
function Viewer::run() as this will automatically assign
TrackballManipualtor if no camera manipulator is already assigned.
It's easy to replace viewer.run() with:

  viewer.realize();
  while(!viewer.done())
  {
      viewer.frame();
  }

As for example to follow, just search the code base for subclasses
from CameraManipulator, or places where setViewMatrix(..) is called.

Robert.
On Sat, Dec 11, 2010 at 9:44 AM, Axel Spirtaat <loginv...@gmail.com> wrote:
> Hi,
> I've created my scene, and now I need to move camera in it, using keyboard.
> My idea is to handle camera using some key lik A, S, W, D to perform 
> tranlations mouse movements to perform camera's rotations.
>
> I know i need to write a new class that inherits from GUIEventHandler, but 
> reading TrackballManipulator i'm not sure to have understood how a 
> GUIAciontAdapter performs this operations.
> For instance, in handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, 
> osg::Object*, osg::NodeVisitor*) method i could call the us.requestRedraw() 
> to perform a visual change when the "D" key is pressed (to perform a 
> translation on x axis). I think that the Viewer object, ccomputes some matrix 
> operation, but i haven't found it.
> Can anyone help me?
>
>
> Thank you!
>
> Cheers,
> Axel
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=34725#34725
>
>
>
>
>
> _______________________________________________
> 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