Transform: {
    position?: THREE.Vector3;
    rotation?: THREE.Vector3;
    scale?: THREE.Vector3;
}

Represents a transform in 3D space, including position, rotation, and scale. Each property is optional and represented as a THREE.Vector3 instance.

  • position: Defines the translation of an object in 3D space.
  • rotation: Defines the rotation of an object in radians for each axis (x, y, z).
  • scale: Defines the scale of an object along each axis.

Type declaration

  • Optionalposition?: THREE.Vector3
  • Optionalrotation?: THREE.Vector3
  • Optionalscale?: THREE.Vector3
// A transform with all properties defined
const transform: Transform = {
position: new THREE.Vector3(10, 20, 30),
rotation: new THREE.Vector3(Math.PI / 2, 0, 0),
scale: new THREE.Vector3(1, 1, 1),
};
// A transform with only position defined
const transform: Transform = {
position: new THREE.Vector3(5, 5, 5),
};
// Default values are undefined for all properties.
const transform: Transform = {};