[osg-users] Camera resize vs setViewport
Ravi Mathur
ravidavi at utexas.edu
Thu Feb 23 19:13:51 PST 2017
Hi all,
In osg::Camera, there exist two resize functions: Camera::resize(width, height) and Camera::setViewport(x, y, width, height). I'm confused conceptually as to when to use which one. Some examples use resize (osgdistortion), whereas others use setViewport (osghud).
Looking at the Camera.cpp code, it looks like resize() calls setViewport(), but why does it not then accept x/y position arguments? For example, I have a CompositeViewer with multiple Views. Each View has a master & slave (HUD) camera, which are set up in a grid format on the GraphicsContext. I initialize each master/slave combo using setViewport() but I can't use Camera::resize() since I can't pass it the x/y coordinates.
What am I missing here? When is it appropriate to call Camera::resize() instead of Camera::setViewport()?
Thanks,
Ravi
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70333#70333
More information about the osg-users
mailing list