Class GlobalTransform

GlobalTransform class

Global transform is similar to Transform but it’s immutable while it represents the final evaluated transformation. Right-hand coordinate system is used while evaluating global transform

public class GlobalTransform

Properties

NameDescription
EulerAngles { get; }Gets the rotation represented in Euler angles, measured in degree
Rotation { get; }Gets the rotation represented in quaternion.
Scale { get; }Gets the scale
TransformMatrix { get; }Gets the transform matrix.
Translation { get; }Gets the translation

Examples

The following code shows how to read node’s global transform

Scene scene = new Scene();
var boxNode = scene.RootNode.CreateChildNode(new Box());
//place the box at (10, 0, 0)
boxNode.Transform.Translation = new Vector3(10, 0, 0);
var global = boxNode.GlobalTransform;
Console.WriteLine($"The box's position in world coordinate is {global.Translation}");

See Also