SubstituteModelFilter:pitch and roll of modelsymbol is not supported

classic Classic list List threaded Threaded
1 message Options
liugaijin liugaijin
Reply | Threaded
Open this post in threaded view
|

SubstituteModelFilter:pitch and roll of modelsymbol is not supported

in modelayer,rotation matrix is calculated as follows:
rot_mat.makeRotate(
                osg::DegreesToRadians(options().orientation()->y()), osg::Vec3(1,0,0),//pitch axis_x
                osg::DegreesToRadians(options().orientation()->x()), osg::Vec3(0,0,1),//heading axis_z
                osg::DegreesToRadians(options().orientation()->z()), osg::Vec3(0,1,0) );//roll axis_y

in modelnode,rotation matrix is calculated as follows:
rot.makeRotate(
                        osg::DegreesToRadians(heading), osg::Vec3(0,0,1),//heading axis_z
                        osg::DegreesToRadians(pitch),   osg::Vec3(1,0,0),//pitch axis_x
                        osg::DegreesToRadians(roll),    osg::Vec3(0,1,0) );//roll axis_y

the axis order is different.  right or wrong?

in substitudemodelfilter, rotation matrix is calculated only by heading, pitch and roll is ignored.

so, I suggest that we should create a class named HeadingPitchRoll, as Cesium does.
this class provide the mutual transformation of Euler Angle and rotation matrix, and the consistency of axis order is ensured.