osg04: osg 3.3.4 矩阵变换节点实例
/**********************************************************
*Write by FlySky
*zzuxp@163.com http://www.OsgChina.org
**********************************************************/
#include <osgViewer/Viewer>
#include <osg/Node>
#include <osg/Geode>
#include <osg/Group>
#include <osg/MatrixTransform>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgUtil/Optimizer>
int main()
{
//创建Viewer对象,场景浏览器
osg

本文通过一个实例展示了如何利用osg库中的MatrixTransform节点进行3D模型的矩阵变换,包括平移和旋转操作。首先创建了一个Viewer对象,接着加载了一个3D模型(牛模型)。然后创建了两个MatrixTransform节点,分别设置了不同的矩阵来实现模型在X轴上的平移和旋转。最后将这两个变换节点添加到场景中,并进行了优化和渲染。
最低0.47元/天 解锁文章
1596

被折叠的 条评论
为什么被折叠?



