Three.js - what do the matrices in a 3D object rep

2019-03-24 15:18发布

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

1条回答
Ridiculous、
2楼-- · 2019-03-24 16:22

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

查看更多
登录 后发表回答