3d geometry: how to interpolate a matrix

前端 未结 6 1839
别跟我提以往
别跟我提以往 2020-12-14 09:25

i store the position of an object in 3d space in a 4by4 transformation matrix. now in order to move the object from the position stored in matrix A to the position stored in

6条回答
  •  無奈伤痛
    2020-12-14 09:42

    If you interpolate all 16 entries of your matrix, the result will look strange since the interpolated matrices will not be rigid transformations (you will get skewing and volume deformations). The proper thing to do is to separate out the translation and rotation/scaling, giving you a translation vector T and a 3x3 rotation matrix R (this only works assuming your original 4x4 represented a rigid transformation). Then take an eigenvalue decomposition of the 3x3 R=Q'DQ (tick means transpose), giving you an orthogonal Q and diagonal scaling D. Now you linearly interpolate T and D, while you slerp the columns of Q, and then you reassemble the matrix.

提交回复
热议问题