I managed to do that inside the `handle` method:
osg::Vec3d eyePos;
osg::Matrix matrix = _viewer->getCameraManipulator()->getMatrix();
eyePos = matrix.getTrans();
lat = eyePos.y();
lon = eyePos.x();
alt = eyePos.z();
On Wednesday, August 22, 2012 at 3:21:20 PM UTC-3, Paul Leopard wrote:
>
> I want to query osgViewer to get the current camera position (Note: not
> the home position). As I move around in a scene I want to know the current
> coordinates of my eyepoint so that I can save it to a configuration file so
> that the next time I run my app I can read that position and set it as the
> home position.
>
> How can I simply get the current eye position (same coordinate frame as
> the home position is specified in).
>
> Thanks in advance,
> Paul
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=49410#49410
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected] <javascript:>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
You received this message because you are subscribed to the Google Groups
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/osg-users/d8156700-7b09-467c-8e69-ed9379b533ea%40googlegroups.com.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org