如何在OpenSceneGraph中缩放/旋转/移动资产

问题描述 投票:-1回答:1

我对OpenSceneGraph完全陌生

我可以打开并保存OSG资产。我需要对其进行一些简单的转换,例如尺寸缩放/旋转/平移。

这似乎很容易,无论如何我都找不到快速文档:/

osg::ref_ptr<osg::Node> rectangle = osgDB::readNodeFile("../../inputs/Rectangle.osg");

// define simple transformation matrix
// apply  simple trnasformation matrix

osgDB::writeNodeFile(*rectangle, "../../outputs/saved.osg");

任何提示?

c++ openscenegraph
1个回答
0
投票

使用类osg :: MatrixTransform,例如参见this example

© www.soinside.com 2019 - 2024. All rights reserved.