[osg-users] How to get Camera Heading Pitch Roll

Wojtek Kowalski karcios at poczta.onet.pl
Mon May 23 01:30:57 PDT 2016


Hi,

Thanks Sebastian,

I also tried
Code:

osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode();
csn->setEllipsoidModel(new osg::EllipsoidModel());
osg::Matrixd local_frame = csn->computeLocalCoordinateFrame(ECEFpnt);

//osg::Quat q = camera->getViewMatrix().getRotate();
osg::Matrix local_frame_inv = osg::Matrix::inverse(local_frame);
osg::Matrix q_local = local_frame_inv * camera->getViewMatrix();

osg::Vec3d hpr1 = getHPRfromQuat(q_local.getRotate(););

But got wrong values :/


Cheers,
Wojtek[/quote]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67199#67199








More information about the osg-users mailing list