I found a small error in calculating the x mouse location after resizing the render window in the osgViewerMFC example. I've traced this back in the debugger to osgViewer::Viewer::eventTraversal(). Line 550 in this file has the correct value:
float x = event->getX(); However, the calculations in lines 599-607 produce an incorrect value for x: osg::Viewport* viewport = getCameraWithFocus()->getViewport(); osg::Matrix localCameraVPW = getCameraWithFocus()->getViewMatrix() * getCameraWithFocus()->getProjectionMatrix(); if (viewport) localCameraVPW *= viewport->computeWindowMatrix(); osg::Matrix matrix( osg::Matrix::inverse(localCameraVPW) * masterCameraVPW ); osg::Vec3d new_coord = osg::Vec3d(x,y,0.0) * matrix; x = new_coord.x(); The viewport is correct, so it looks like the view matrix or projection matrix aren't being refreshed properly after a resize. The y value is always correct :/ Not sure where to look from here...any ideas? Thx
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

