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

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Mon May 23 01:35:34 PDT 2016


HI,
> 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();
Try inverting the matrix multiplication...
>
> osg::Vec3d hpr1 = getHPRfromQuat(q_local.getRotate(););
>
> But got wrong values :/
Define: wrong
>
>
> Cheers,
> Wojtek[/quote]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67199#67199
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





More information about the osg-users mailing list