[osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

Rodrigo Dias rodrigo1406 at gmail.com
Wed Jan 16 08:04:40 PST 2019


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







More information about the osg-users mailing list