Hello,
it works! I'm very happy now. It was another mistake.
I have write my EventHandler and call the handle-method of the manipulator in
the handle method of my handler. That was the first idea of Jean-Sebastien. My
problem was I had define another event handler above and this makes problems
for my second event handler.
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::FRAME):
_activeViewport = getActiveViewport(ea);
_tm = _viewports[_activeViewport]->getManipulator();
_viewports[_activeViewport]->setViewMatrix(_tm->getInverseMatrix());
}
return _tm->handle(ea,us);
}
That is my solution.
Cheers
Martin
-------- Original-Nachricht --------
> Datum: Wed, 03 Nov 2010 15:19:28 +0100
> Von: "Martin Großer" <[email protected]>
> An: OpenSceneGraph Users <[email protected]>
> Betreff: Re: [osg-users] How can I calculate a matrix via a MatrixManipulator
> Yes I know, but I won't to use the CompositeViewer. Because I will use
> this feature in the gtk embedded viewer.
>
> Cheers
>
> Martin
>
>
> -------- Original-Nachricht --------
> > Datum: Wed, 03 Nov 2010 10:13:24 -0400
> > Von: "Jean-Sébastien Guay" <[email protected]>
> > An: OpenSceneGraph Users <[email protected]>
> > Betreff: Re: [osg-users] How can I calculate a matrix via a
> MatrixManipulator
>
> > Hi Martin,
> >
> > > Maybe my problem declaration is unclear. Sorry about this. The goal is
> I
> > doesn't want to set the camera (master camera) of the viewer. That do
> the
> > CameraManipulator. I want use the Matrix (or inverse matrix) to set the
> > view matrix of another camera. I have 4 cameras (viewports) and I want
> change
> > only the camera of one viewport.
> > >
> > > Is this an better explanation? I hope so.
> >
> > Are you using CompositeViewer with multiple Views? Each view has its own
> > camera, and can have different camera manipulators. So when you
> > manipulate the camera in one view it won't affect other views.
> >
> > You can always call getInverseMatrix() yourself on the manipulator and
> > then pass that matrix to the camera you want to manipulate,
> > CompositeViewer and CameraManipulators are designed to do this for you.
> >
> > J-S
> > --
> > ______________________________________________________
> > Jean-Sebastien Guay [email protected]
> > http://www.cm-labs.com/
> > http://whitestar02.webhop.org/
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> --
> GRATIS! Movie-FLAT mit über 300 Videos.
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org