0

所以我定义了这个 Box,它的大小为 (1, 2, 3),我沿所有三个轴旋转 45°:

Transform {
  rotation 1 1 1 0.7854
  children [
    Shape {
      appearance Appearance { material Material {} }
      geometry Box { size 1 2 3 }
    }
  ]
}

但是当我分别沿每个轴应用相同的旋转时,我得到另一个结果:

Transform {
  rotation 0 0 1 0.7854
  children [
    Transform {
      rotation 0 1 0 0.7854
      children [
        Transform {
          rotation 1 0 0 0.7854
          children [
            Shape {
              appearance Appearance { material Material {} }
              geometry Box { size 1 2 3 }
            }
          ]
        }
      ]
    }
  ]
}

维基百科告诉我,我可以像这样将所有旋转矩阵相乘:R = R(x)R(y)R(z)?

这是上面代码的结果:

结果

4

1 回答 1

1

您描述的第一个旋转不是围绕三个轴的旋转,而是围绕轴(1,1,1)的旋转,这是不同的。那么你没有得到预期的结果是正常的。如果您希望可以根据维基百科的公式计算轴 (1,1,1) 和角度 45 的旋转矩阵,并将其与每个轴 x、y、z 和角度 45 的旋转矩阵的乘积进行比较,然后您会看到你得到不同的矩阵。

于 2017-06-24T10:06:12.480 回答