Transform Transform { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Transform property of the PolygonMesh class represents the position, rotation, and scale of the mesh in world space. This property is crucial for determining where the mesh is located and how it is oriented within the scene.

Usage

Use the Transform property to get or set the transformation of the mesh in the world. This can be useful for moving, rotating, or scaling the mesh within the scene.

Example

// Example of setting the Transform property
PolygonMesh mesh = new PolygonMesh();
Transform newTransform = new Transform();
newTransform.Position = new Vector3(10, 0, 5);
newTransform.Rotation = Rotation.From(45, 0, 0);
newTransform.Scale = new Vector3(1, 1, 1);

mesh.Transform = newTransform;

// Example of getting the Transform property
Transform currentTransform = mesh.Transform;
Vector3 position = currentTransform.Position;
Rotation rotation = currentTransform.Rotation;
Vector3 scale = currentTransform.Scale;