3D场景的比例几何

单个3D节点或3D场景的所有节点的缩放几何形状

开发人员只能缩放3D节点的几何形状或3D场景的所有节点。为了实现这一点,开发人员可以调用PolygonModifier类实例的多个规模成员。这是缩放所有节点或单个节点的代码示例:

C#

 // scale the model in huge-scene.obj by 0.01 and save it to another file:

Scene scene = new Scene("huge-scene.obj");

// create a Box instance

var box = scene.RootNode.CreateChildNode("box", new Box());

// scale geometries of a single node

PolygonModifier.Scale(box, new Vector3(0.01));

// scale geometries of all nodes

PolygonModifier.Scale(scene, new Vector3(0.01));

scene.Save("scaled-scene.obj", FileFormat.WavefrontOBJ);