[osg-users] Change Perspective to Orthogonal View
Robert Osfield
robert.osfield at gmail.com
Mon Mar 6 00:42:05 PST 2017
Hi Rômulo,
You can simply via the Camera::setProjectionMatrixAsOrtho(...) method.
Have a look at the include/osg/Camera header. Also have a look at
gluOrtho docs online to understand the parameters used and mean as the
OSG uses a 1:1 mapping in terminology and implementation.
Robert.
On 6 March 2017 at 00:51, Rômulo Cerqueira <romulogcerqueira at gmail.com> wrote:
> Hi,
>
> I like to change the current perspective view of my camera to an orthogonal projection, keeping the same position. How can I do this?
>
> My current code of perspective camera:
>
>
> Code:
>
> _viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
> _viewer->getCamera()->setProjectionMatrixAsPerspective(fovY * 180.0 / M_PI, aspectRatio, 0.1, 1000);
>
>
>
>
>
> ...
>
> Thank you!
>
> Cheers,
> Rômulo
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70409#70409
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
More information about the osg-users
mailing list