Rotation Matrix given angle and point in X,Y,Z

前端 未结 3 1906
故里飘歌
故里飘歌 2020-12-03 19:57

I am doing image manipulation and I want to rotate all of the pixels in xyz space based on an angle, the origin, and an x,y, and z coordinate.

I just need to setup t

3条回答
  •  自闭症患者
    2020-12-03 20:28

    The complete rotation matrices are derived and given at https://sites.google.com/site/glennmurray/Home/rotation-matrices-and-formulas.

    From the paper:

    5.2 The simplified matrix for rotations about the origin

    Note this assumes that (u, v, w) is a direction vector for the axis of rotation and that u^2 + v^2 + w^2 = 1.

    Simplified 3D matrix for rotations about the origin.

    If you have a point (x, y, z) that you want to rotate, then we can obtain a function of of seven variables that yields the rotated point:

    f(x, y, z, u, v, w, theta) =

    Formula for rotated point.

    The paper also includes matrices and formulas for rotations about an arbitrary axis (not necessarily through the origin), Java code available under the Apache license, and a link to a web app that illustrates rotations.

提交回复
热议问题