Re: [osg-users] Change Perspective to Orthogonal View

2017-03-06 Thread Robert Osfield
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  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@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] Change Perspective to Orthogonal View

2017-03-05 Thread Rômulo Cerqueira
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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org