Looking at the source of THREE.Object3D, there are three properties: matrix
, matrixWorld
and matrixRotationWorld
.
I see that the object's position, scale and rotation can be extracted from matrix
. I also see that the world position of a point on the object can be extracted from matrixWorld
.
My question:
Do matrix
and matrixWorld
represent the same information, i.e. can matrix be converted to matrixWorld, and vice versa?
What does matrixRotationWorld represent? What is it used for? And can it be converted to matrix
and/or matrixWorld
?
Thanks
Three. js uses matrices to encode 3D transformations---translations (position), rotations, and scaling. Every instance of Object3D has a matrix which stores that object's position, rotation, and scale.
A class representing a 4x4 matrix. The most common use of a 4x4 matrix in 3D computer graphics is as a Transformation Matrix. For an introduction to transformation matrices as used in WebGL, check out this tutorial.
object.matrix
is the matrix transform of the object.
object.matrixWorld
is the matrix transform of the object, taking into consideration the matrix transform of the object's parent. (The object's parent may also have a parent, so the calculation of object.matrixWorld
is recursive.)
object.matrix
and object.matrixWorld
are identical when the object has no parent, other than the scene.
object.matrixRotationWorld
no longer exists.
three.js r.69
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With