3d (THREE.js):差分矩阵 [英] 3d (THREE.js) : difference matrix
问题描述
我想保存代表两个 THREE.Object3d 之间相对差异的信息.我更喜欢将数据保存为转换矩阵.
I would like to save the info that represents the relative difference between two THREE.Object3d. I prefer to save the data as a transformation matrix.
有人知道我需要做什么才能得到这个吗?
Can someone knows what do i need to do to get this?
我想要一个 matrix4,稍后我可以将它应用到一个对象上,它会以相同的值移动/旋转.
I would like to have a matrix4 that later on i could apply on an object and it will move/rotate by the same values.
谢谢
推荐答案
所以您有两个转换 A 和 B,您正在寻找将 A 转换为 B 的转换 T,对吗?正式写成
So you have two transformations A and B you are looking for the transformation T that transforms A into B, right? Formally this is written as
B = T·A
现在你可以认为从 A 到 B,就像从 A 返回到身份 (I),然后从身份到 B,即
Now you can think of going from A to B, as going back from A to identity (I) and then from identity to B i.e.
从 A 回到 I:
I = inv(A) · A
I = inv(A) · A
从I到B
B = B·I
把它串联起来
B = B·inv(A)·A
B = B · inv(A) · A
添加几个括号以突出显示内容:
Add a few parentheses to highlight things:
B = ( B · inv(A) ) · A
B = ( B · inv(A) ) · A
与第一个等式相比,我们看到
Comparing that with the first equation we see that
T = B·inv(A)
T = B · inv(A)
这篇关于3d (THREE.js):差分矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!