| | 99 | } |
| | 100 | |
| | 101 | |
| | 102 | void testMatrixInvert(const osg::Matrix& matrix) |
| | 103 | { |
| | 104 | //Invert it twice using the two inversion functions and view the results |
| | 105 | osg::notify(osg::NOTICE)<<"testMatrixInvert("<<std::endl; |
| | 106 | osg::notify(osg::NOTICE)<<matrix<<std::endl; |
| | 107 | osg::notify(osg::NOTICE)<<")"<<std::endl; |
| | 108 | |
| | 109 | osg::Matrix invM1_0; |
| | 110 | invM1_0.invert(matrix); |
| | 111 | osg::notify(osg::NOTICE)<<"Matrix::invert"<<std::endl; |
| | 112 | osg::notify(osg::NOTICE)<<invM1_0<<std::endl; |
| | 113 | osg::Matrix default_result = matrix*invM1_0; |
| | 114 | osg::notify(osg::NOTICE)<<"matrix * invert="<<std::endl; |
| | 115 | osg::notify(osg::NOTICE)<<default_result<<std::endl;; |
| | 116 | |
| 372 | 390 | testLookAt(osg::Vec3(10.0,4.0,2.0),osg::Vec3(10.0,4.0,2.0)+osg::Vec3(0.0,1.0,0.0),osg::Vec3(0.0,0.0,1.0)); |
| 373 | 391 | testLookAt(osg::Vec3(10.0,4.0,2.0),osg::Vec3(10.0,4.0,2.0)+osg::Vec3(1.0,1.0,0.0),osg::Vec3(0.0,0.0,1.0)); |
| | 392 | |
| | 393 | testMatrixInvert(osg::Matrix(0.999848, -0.002700, 0.017242, -0.1715, |
| | 394 | 0, 0.987960, 0.154710, 0.207295, |
| | 395 | -0.017452, -0.154687, 0.987809, -0.98239, |
| | 396 | 0, 0, 0, 1)); |
| | 397 | |
| | 398 | testMatrixInvert(osg::Matrix(0.999848, -0.002700, 0.017242, 0.0, |
| | 399 | 0.0, 0.987960, 0.154710, 0.0, |
| | 400 | -0.017452, -0.154687, 0.987809, 0.0, |
| | 401 | -0.1715, 0.207295, -0.98239, 1.0)); |