Hey all.

I'm having some trouble using TrackballManipulator with
GraphicsWindowEmbedded. The two main problems are:

* I have to pass normalized x,y coordinates (ie, x/width(),
y/height()) to the graphics window's event queue. Looking at other
examples, this doesn't seem right.

* Zoom and Pan seem to be working, but Rotation just rotates around
the plane that the window itself represents (so it rotates the view in
2D on the plane that has a normal in the camera's lookAt direction)

I've set up the graphics window and viewer as follows:

    // setup viewer and window
    m_osg_viewer = new osgViewer::Viewer;
    m_osg_window =
m_osg_viewer->setUpViewerAsEmbeddedInWindow(0,0,this->width(),this->height());
    m_osg_window->getState()->setUseModelViewAndProjectionUniforms(true);
    m_osg_window->getState()->setUseVertexAttributeAliasing(true);
    m_osg_viewer->setCameraManipulator(new osgGA::TrackballManipulator);
    m_osg_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
    m_osg_viewer->setSceneData(groupRoot);

In addition I've tried:
 * Setting an initial position and perspective matrix for the camera
 * Calling setMouseInputRange and setUseFixedMouseInputRange on the
graphic window's event queue

But they didn't have any effect. Am I just missing something obvious?


Preet
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to