做商城网站要哪些流程图,长春网络传媒做网站骗钱,做网站推广有什么升职空间,事件营销的经典案例加载2个模型#xff0c;其中一个向上移动28个单位#xff1b; 加载2个模型#xff0c;其中一个缩放0.5倍#xff0c;向下移动22个单位#xff1b; 加载2个模型#xff0c;其中一个缩放0.5倍、旋转45度、向右向下移动几个单位#xff1b; 都是用矩阵实现的#xff1b;
…加载2个模型其中一个向上移动28个单位 加载2个模型其中一个缩放0.5倍向下移动22个单位 加载2个模型其中一个缩放0.5倍、旋转45度、向右向下移动几个单位 都是用矩阵实现的
#includeosgDB\ReadFile
#includeosgViewer\Viewer
#includeosg\Node
#includeosg\MatrixTransformvoid main()
{osgViewer::Viewer viewer;osg::ref_ptrosg::Group root new osg::Group();osg::ref_ptrosg::Node bignathan osgDB::readNodeFile(航天器.3ds);osg::ref_ptrosg::MatrixTransform trans new osg::MatrixTransform;trans-setMatrix(osg::Matrix::translate(0, 0, 28));trans-addChild(bignathan.get());osg::ref_ptrosg::MatrixTransform scale new osg::MatrixTransform;scale-setMatrix(osg::Matrix::scale(0.5, 0.5, 0.5)*osg::Matrix::translate(0, 0, -22));scale-addChild(bignathan.get());osg::ref_ptrosg::MatrixTransform rot new osg::MatrixTransform;rot-setMatrix(osg::Matrix::rotate(osg::DegreesToRadians(45.0), 1, 0, 0)*osg::Matrix::scale(0.5, 0.5, 0.5)*osg::Matrix::translate(14, 0, -12));rot-addChild(bignathan.get());root-addChild(bignathan.get());//root-addChild(trans.get());//root-addChild(scale.get());root-addChild(rot.get());viewer.setSceneData(root.get());viewer.realize();viewer.run();
}