Hi Gianni, Robert,

yes, this will be like map view. I am familiar with the Camera interface
and the GL/GLU counterparts. The projection matrix should for sure be
ortho2D, just struggling with the view matrix how to set it up to have the
scene to fit exactly in ... thinking ...

Thanks for any hint

On Wed, Aug 30, 2017 at 11:57 AM, Gianni Ambrosio <[email protected]>
wrote:

> Hi Nick,
> I'm not sure my scenario is like mine but hope this code snippet may help:
>
>
> Code:
>
> void setViewTowardsXMinus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3d(
> nodeTrackerManipulator->getDistance(), 0.0, 0.0)), osg::Vec3d(0.0, 0.0,
> 0.0), nodeTrackerManipulator->getHomeUpPosition());
> }
>
> void setViewTowardsXPlus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3d(-
> nodeTrackerManipulator->getDistance(), 0.0, 0.0)), osg::Vec3d(0.0, 0.0,
> 0.0), nodeTrackerManipulator->getHomeUpPosition());
> }
>
> void setViewTowardsYMinus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3d(0.0,
> nodeTrackerManipulator->getDistance(), 0.0)), osg::Vec3d(0.0, 0.0, 0.0),
> nodeTrackerManipulator->getHomeUpPosition());
> }
>
> void setViewTowardsYPlus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3d(0.0,
> -nodeTrackerManipulator->getDistance(), 0.0)), osg::Vec3d(0.0, 0.0, 0.0),
> nodeTrackerManipulator->getHomeUpPosition());
> }
>
> void setViewTowardsZMinus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3d(0.0,
> 0.0, nodeTrackerManipulator->getDistance())), osg::Vec3d(0.0, 0.0, 0.0),
> nodeTrackerManipulator->getHomeUpPosition());
> }
>
> void setViewTowardsZPlus()
> {
>    nodeTrackerManipulator->setTransformation(computeEye(osg::Vec3(0.0f,
> 0.0f, -nodeTrackerManipulator->getDistance())), osg::Vec3d(0.0, 0.0,
> 0.0), nodeTrackerManipulator->getHomeUpPosition());
> }
>
> osg::Vec3d computeEye(const osg::Vec3d& iEye)
> {
>    osg::Vec3d eye = iEye;
>    ...
>    double psi, theta, phi;
>    graphicObject->getInitialRotation(psi, theta, phi);
>    osg::Quat initAttitude = viosg::quatFromBody313(psi, theta, phi);
>    eye = initAttitude * graphicObject->getTransformNode()->getAttitude()
> * eye;
>    return eye;
> }
>
>
>
>
> Cheers,
> Gianni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71564#71564
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to