Hello -
I am attempting to use the output from an attitude & heading reference
system to orient the Camera over some terrain which I created using the
National Elevation Dataset and VirtualPlanetBuilder. When I view the
terrain database using osgviewer, I see everything as I expect.
However.. when I take out the pre-built camera manipulators, I end up
not being able to see any terrain at all. I get a blank blue screen (or,
more recently, a blank black screen).
Rather than calling viewer.run(), I'm doing:
while (!viewer.done() && sensorHasData) {
cameraRotation.makeRotate(
osg::DegreesToRadians(euler_data.m_roll),
osg::Vec3(0,1,0), // roll
osg::DegreesToRadians(euler_data.m_pitch),
osg::Vec3(1,0,0) , // pitch
osg::DegreesToRadians(euler_data.m_yaw),
osg::Vec3(0,0,1) ); // heading
myCameraMatrix = (cameraOffsetRotation * cameraRotation) *
cameraTrans;
osg::Matrixd i = myCameraMatrix.inverse(myCameraMatrix);
viewer.getCamera()->setViewMatrix(( osg::Matrixd(i.ptr() )) *
osg::Matrixd::rotate( -M_PI/2.0, 1, 0, 0 ) );
viewer.frame();
}
It seems like setting a manipulator is required, but from research it
seems like I should be able to manipulate the camera's view inside the
while loop as well.
I must be missing something. I've been working my way through the OSG
3.0 Beginners Guide, but I'm just stuck in this rut.
What could I be doing wrong?
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org