Matrix4.decompose()
方法将Matrix4转换为位置、缩放和旋转三个元素的分解形式。
decompose( position: Vector3, quaternion: Quaternion, scale: Vector3 )
position
- 必需,类型为Vector3
,代表物体的位置。quaternion
- 必需,类型为Quaternion
,代表物体的旋转。scale
- 必需,类型为Vector3
,代表物体的缩放。如果成功分解,返回true,否则返回false。
const matrix = new THREE.Matrix4();
const position = new THREE.Vector3();
const scale = new THREE.Vector3();
const quaternion = new THREE.Quaternion();
matrix.decompose( position, quaternion, scale );
console.log( position );
console.log( scale );
console.log( quaternion );