I wont to rotate QuickTime Move 180 degrees.
Now my file's matrix(tkhd) is
1 0 0
0 1 0
0 0 1
I got this matrix form Dumpster.
What is the 3 × 3 matrix for a rotation of 180 degrees?
I wont to rotate QuickTime Move 180 degrees.
Now my file's matrix(tkhd) is
1 0 0
0 1 0
0 0 1
I got this matrix form Dumpster.
What is the 3 × 3 matrix for a rotation of 180 degrees?
Assuming you want a 3x3 homogeneous matrix for a 2D rotation about the Z-axis, then the matrix you want is:
-1 0 0 0 -1 0 0 0 1
If you want to rotate about a different axis, then the matrix will be different.
Negate the two vectors that aren't the axis you want to rotate around.
So: You can take an ID matrix, negate the 1 for two axis you want affected, and leave the one you want to rotate around unaffected, then you can multiply the two.
Or if you have access to the axes individually (say you use an API that offers that), just use something ala myMtx.xAxis.NegateInPlace(); myMtx.zAxis.NegateInPlace() for a rotation around Y, and so on.
For a 3D rotation about an axis e, note that a rotation of 180 degrees about an axis e will keep the component of any vector x along e the same and impart a negative sign to the perpendicular component. Let x' be the rotated vector. Then:
-1 0 0
0 -1 0
0 0 -1
that should be the right matrix