Rotation around a specific point (eg, rotate around 0,0,0)

后端 未结 1 1745
忘掉有多难
忘掉有多难 2021-01-07 04:15

I\'ve been searching a lot on this problem, but I couldn\'t really find an answer that would fit.
I need to rotate a cylinder around a given point (eg, 0,0,0), but the p

1条回答
  •  逝去的感伤
    2021-01-07 05:13

    The general procedure for rotation about an arbitrary point P is:

    1. Translate by -P (so P is at (0, 0, 0))
    2. Rotate around the origin
    3. Translate by P (to bring the origin back to the original location of P)

    The easiest way to do this is to represent everything in homogeneous coordinates and represent translations and rotations by matrices. Composing the above three transformations (translate-rotate-translate) is done by matrix multiplication. If the rotation is composed of two or more simpler rotations, then the rotation matrix itself is a product of the matrices for the simpler rotations.

    0 讨论(0)
提交回复
热议问题