Solved:

https://github.com/eco-info/osgCookbook/blob/master/outros/terreno1/terreno1.cpp

On Wednesday, January 16, 2019 at 2:04:12 PM UTC-2, Rodrigo Dias wrote:
>
> Thank you, Glenn, but this part was already solved. 
>
> About sending the camera's coordinates to screen text, I've found a 
> solution elsewhere: 
>
>
> Code: 
>         Vec3f eye; 
>         while ( !viewer.done() ) { 
>                 eye = 
> viewer.getCamera()->getInverseViewMatrix().getTrans(); 
>                 text1->setText((L"Heading: " + 
> to_wstring(eye.x())).c_str()); 
>                 text2->setText((L"Pitch: " +   
> to_wstring(eye.y())).c_str()); 
>                 text3->setText((L"Roll: " +   
>  to_wstring(eye.z())).c_str()); 
>                 viewer.frame(); 
>         } 
>
>
>
>
> or 
>
>
> Code: 
>         Vec3f eye, center, up; 
>         while ( !viewer.done() ) { 
>                 viewer.getCamera()->getViewMatrixAsLookAt( eye, center, up 
> ); 
>                 text1->setText((L"Heading: " + 
> to_wstring(eye.x())).c_str()); 
>                 text2->setText((L"Pitch: " +   
> to_wstring(eye.y())).c_str()); 
>                 text3->setText((L"Roll: " +   
>  to_wstring(eye.z())).c_str()); 
>                 viewer.frame(); 
>         } 
>
>
>
>
> Now the numbers change as I move the scene around using 
> TrackballManipulator. However, the keys don't change any number when I use 
> FirstPersonManipulator. I tried to look at the source code for examples: 
>
>
> > grep -nrw . -e 'FirstPersonManipulator' --include=*.cpp 
>
>
> but this only returns lines from osgGA/FirstPersonManipulator.cpp 
>
> How can I know how to use FirstPersonManipulator without a program that 
> uses it? 
>
> ------------------ 
> Read this topic online here: 
> http://forum.openscenegraph.org/viewtopic.php?p=75499#75499 
>
>
>
>
>
> _______________________________________________ 
> osg-users mailing list 
> osg-users@lists.openscenegraph.org 
> 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 osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/f227f01f-072c-42f6-8057-8b4673ebe590%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to