Three.js:如何将旋转矩阵应用于某些基础对象的状态? [英] Three.js: how to apply rotation matrix to some base object's state?
问题描述
这个问题
Three.js:applyMatrix之后的混沌网格旋转 >
我问了一个问题.
现在,我将尝试从另一个角度看问题:描述程序的期望行为.
对于对象状态的每个时间点,我都有一个旋转矩阵数组. 每个旋转矩阵表示某个初始对象状态(零点)与所需状态之间的差.用户应该可以随时从阵列中选择任何所需的旋转矩阵.
如何对此类数据进行正确的轮换?
Three.js r.58
Three.js希望用户设置对象的position
,rotation
和scale
,然后渲染器更新对象matrix
在render()
函数中.
通常不建议直接操作矩阵,除非您真的知道自己在做什么.
无论如何,这样的事情应该起作用.
object.matrix.copy( matrixIntiial );
object.applyMatrix( matrixDelta );
three.js r.58
In this question
Three.js: chaotic mesh rotation after applyMatrix
I asked about an issue.
Now I'll try to look at the issue from another end: to describe the desired behaviour of the program.
I have an array of rotation matrices for each time point of object's state. Each rotation matrix represents a difference between some initial object state (point zero) and the desired state. User should be able at any time select any desired rotation matrix from the array.
How to implement the correct rotation for such data?
Three.js r.58
Three.js expects the user to set the object's position
, rotation
, and scale
, and then the renderer updates the object matrix
in the render()
function.
Usually it is unadvisable to manipulate the matrix directly, unless you really know what you are doing.
In any event, something like this should work.
object.matrix.copy( matrixIntiial );
object.applyMatrix( matrixDelta );
three.js r.58
这篇关于Three.js:如何将旋转矩阵应用于某些基础对象的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!