On Tue, 2010-10-05 at 20:13 +0200, Matt Caron wrote: > I'm trying to write my own camera manipulator and I'm having a difficult time > figuring out how the current camera manipulators work. > > I have read through source code for a number of the manipulator classes > including FlightManipulator, FirstPersonManipulator, StandardManipulator, and > CameraManipulator. > > I can't seem to track down the code that actually manipulates the camera. I > see a bunch of instance variables being altered and GUIEventAdapters getting > passed off to other methods, but I just can't seem to get down far enough in > the code to see where the manipulation is occurring. > > I think I noticed a frame() method in one of the lower level classes - is > this where all the data is used to compute new camera position and location? > If so, how does that frame() method know to use the velocity, acceleration, > pitch, yaw, etc that is built into subclasses like FlightManipulator? > > Any clarification about how the camera manipulator class structure works > would be appreciated. > > Additionally, I am having difficulty understanding the use of quaternions in > relation to the OSG coordinate system. If someone could point me towards > some descriptive reference material on working in the OSG coordinate system I > would appreciate it. > > Thanks.
If I'm not mistaken, you just need to define your own versions of the pure virtuals in CameraManipulator(); particularly getInverseMatrix. And remember, if you use a matrix created by Matrix::makeLookAt, that is ALREADY inverted. :) (Cedric helped me with that...) > Matt > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=32416#32416 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- Follow us on Twitter! http://twitter.com/emperorlinux EmperorLinux, Inc. http://www.emperorlinux.com 1-888-651-6686 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org