<div dir="ltr"><div>Hi Gianni, Robert,</div><div><br></div><div>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 ... </div><div><br></div><div>Thanks for any hint</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 30, 2017 at 11:57 AM, Gianni Ambrosio <span dir="ltr"><<a href="mailto:g.ambrosio+osg@gmail.com" target="_blank">g.ambrosio+osg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<br>
I'm not sure my scenario is like mine but hope this code snippet may help:<br>
<br>
<br>
Code:<br>
<br>
void setViewTowardsXMinus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3d(<wbr>nodeTrackerManipulator-><wbr>getDistance(), 0.0, 0.0)), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
void setViewTowardsXPlus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3d(-<wbr>nodeTrackerManipulator-><wbr>getDistance(), 0.0, 0.0)), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
void setViewTowardsYMinus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3d(0.0, nodeTrackerManipulator-><wbr>getDistance(), 0.0)), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
void setViewTowardsYPlus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3d(0.0, -nodeTrackerManipulator-><wbr>getDistance(), 0.0)), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
void setViewTowardsZMinus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3d(0.0, 0.0, nodeTrackerManipulator-><wbr>getDistance())), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
void setViewTowardsZPlus()<br>
{<br>
nodeTrackerManipulator-><wbr>setTransformation(computeEye(<wbr>osg::Vec3(0.0f, 0.0f, -nodeTrackerManipulator-><wbr>getDistance())), osg::Vec3d(0.0, 0.0, 0.0), nodeTrackerManipulator-><wbr>getHomeUpPosition());<br>
}<br>
<br>
osg::Vec3d computeEye(const osg::Vec3d& iEye)<br>
{<br>
osg::Vec3d eye = iEye;<br>
...<br>
double psi, theta, phi;<br>
graphicObject-><wbr>getInitialRotation(psi, theta, phi);<br>
osg::Quat initAttitude = viosg::quatFromBody313(psi, theta, phi);<br>
eye = initAttitude * graphicObject-><wbr>getTransformNode()-><wbr>getAttitude() * eye;<br>
return eye;<br>
}<br>
<br>
<br>
<br>
<br>
Cheers,<br>
Gianni<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=71564#71564" target="_blank" rel="noreferrer">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=71564#<wbr>71564</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank" rel="noreferrer">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>