I also misunderstood the question. Apparently, you want to allow the window to be resized, but only in such a way that the window's aspect ratio is always the same. This really has little to do with OSG (except that you might use an osgGA event handler to capture the resize events and do the appropriate thing). And you're right, the projection matrix is independent of the window, so you should not need to change the projection matrix at all.
   -Paul

On 1/22/2013 8:22 AM, Laurens Voerman wrote:
Hi Ethan,
I did not understand your question correctly. Setting the camera to
camera->setProjectionResizePolicy(osg::Camera::FIXED) will fix the projection,
not the window. As the version you want is not implemented in osg, you will need
to catch resize attempts and force the window to resize while preserving the
aspect ratio.
the osgviewer application has a
         viewer.addEventHandler(new osgViewer::WindowSizeHandler);
You probably should replace that with a new handler, allowing only to resize
with fixed aspect ratio.
Laurens.

On 1/22/2013 2:10 PM, Ethan Fahy wrote:
Hi Laurens,

I tried setting the resize policy as you suggested for the osgViewer::Viewer
default camera as well as the rtt camera and hud camera that are in my
project, but I was still able to freely resize my viewer window without it
locking.  I didn't get any errors, it just didn't lock the window size.
Perhaps there is a difference between projection size and window size.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52066#52066





_______________________________________________
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


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to