| 177 | | osg::Matrixd baseMatrix = _modelGroupTransform->getMatrix(); |
| 178 | | |
| 179 | | osg::Matrixd preTransMatrix; |
| 180 | | osg::Matrixd postTransMatrix; |
| 181 | | osg::Matrixd rotMatrixX; |
| 182 | | osg::Matrixd rotMatrixZ; |
| 183 | | |
| 184 | | preTransMatrix.makeTranslate(_rotCenter); |
| 185 | | postTransMatrix.makeTranslate(-_rotCenter); |
| 186 | | |
| 187 | | rotMatrixZ.makeRotate((x - _prevX) * 3., osg::Vec3d(0.0, 0.0,1.0)); |
| 188 | | |
| 189 | | baseMatrix.preMult(preTransMatrix); |
| 190 | | baseMatrix.preMult(rotMatrixZ); |
| 191 | | baseMatrix.preMult(postTransMatrix); |
| 192 | | |
| 193 | | rotMatrixX.makeRotate(-(y - _prevY) * 3., (baseMatrix * osg::Vec3d(1.0, 0.0,0.0))); |
| 194 | | |
| 195 | | baseMatrix.preMult(preTransMatrix); |
| 196 | | baseMatrix.preMult(rotMatrixX); |
| 197 | | baseMatrix.preMult(postTransMatrix); |
| | 177 | osg::Matrix baseMatrix = _modelGroupTransform->getMatrix(); |
| | 178 | |
| | 179 | baseMatrix.preMultTranslate(_rotCenter); |
| | 180 | baseMatrix.preMultRotate(osg::Quat((x - _prevX) * 3, osg::Vec3d(0.0, 0.0, 1.0))); |
| | 181 | baseMatrix.preMultRotate(osg::Quat(-(y - _prevY) * 3, (baseMatrix * osg::Vec3d(1.0, 0.0, 0.0)))); |
| | 182 | baseMatrix.preMultTranslate(-_rotCenter); |