|
Now I have a question about matrix extracting. As you know, 3D animation mostly use matrix to store information. And I use d3d to programe my animation. I want to extract a matrix to three sub values, translation, scaling and rotation. But I can't extract it accurately.
The matrix in d3d is 4x4 matrix. like the matrix, M
| 00 10 20 30 |
M = | 01 11 21 31 |
| 02 12 22 32 |
| 03 13 23 33 |
My opinion is :
v0 = v(03,13,23), so matrix Mt can represent the translation value
| 1 0 0 v0.x |
Mt = | 0 1 0 v0.y |
| 0 0 1 v0.z |
| 0 0 0 1 |
v1= v(00,10,20) v2 = v(01,11,21) v3= v(02,12,22)
L1= length(v1) L2 = length(v2) L3 = length(v3)
So Matrix ms can represent the scaling value.
v7= v(L1,L2,L3)
| v7.x 0 0 0 |
Ms = | 0 v7.y 0 0 |
| 0 0 v7.z 0 |
| 0 0 0 1 |
V4 = normalize(v1) V5 = normalize(v2) V6 = normalize(v3)
And we can use a matrix to represent a rotation matrix.
| V4.x V4.y V4.z 0 |
Mr = | V5.x V5.y V5.z 0 |
| V6.x V6.y V6.z 0 |
| 0 0 0 0 |
What I want to do is linear interpolation between two matrices. And using to a matrix including three properties,translation, scaling and rotation, I must extract the three sub values from origin matrix and make linear interpolation respectively. But the result is not what I expect. So I think that the method extract matrix, maybe, is wrong. |
|