从球坐标旋转体
是否可以旋转其顶点在球坐标中定义的物体。 目前我正在使用 VHDL 进行拼贴项目,涉及旋转十二面体并通过 VGA 进行呈现。
我应用了针孔相机模型方程,并且每个顶点只需要两次正弦/余弦计算和两次乘法。 我只是想在两个角度上使用 3 个步骤绕第三轴旋转,但我无法找出正确的方程,即使这是可能的。
编辑
我想我明白了。
一旦计算出相机坐标,在与相机方向相同的第三轴上旋转只是相机坐标的二维变换。这意味着比在 3 个轴上旋转(可以是两个轴和一个倾角)您需要应用总共 4 次正弦/余弦计算和 4 次乘法。如果有人想出了更好的办法,可以随意发表答案。
Is it possible to rotate body which has its vertices defined in spherical coordinates.
Currently I am doing collage project in VHDL and is about rotating dodecahedron and presenting over VGA.
I applied pinhole camera model equations and that required just two sin/cos calculation and two multiplication per vertice.
I was just thinking about rotating around 3rd axis using 3 steps over two angles but i am unable to figure out proper equations and even if this is possible.
Edit
I think I got it.
Rotating over 3rd axis which is in same direction as camera is just 2D transform of camera coordinates once you you compute them. That mean than for rotating in 3 axes (ok two axis and one inclination) you need to apply total of 4 sin/cos computations and 4 multiplications. If somebody came up whit something better, fell free to post answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过改变 θ 可以绕 y 轴旋转,通过改变 φ 可以绕 z 轴旋转。不过,绕 x 轴旋转有点困难。
一种简单的方法是将所有内容转换为笛卡尔坐标,执行旋转,然后转换回来。
(x,y,z)(球面到笛卡尔)的方程
为 将 (x,y,z) 绕 x 轴旋转一个角度到新点 (x', y', z') 的方程α 是
(r, θ, φ) (笛卡尔到球面)的方程是
我不知道是否有办法进一步减少它,但它应该有效。
You can rotate around the y-axis by changing θ, and rotate around the z-axis by changing φ. Rotating around the x-axis, though, is a bit tougher.
One simple way would be to convert everything to catesian coordinates, perform the rotation, and convert back.
The equations for (x,y,z) (spherical-to-cartesian) are
The equations for rotating (x,y,z) to new points (x', y', z') around the x-axis by an angle α are
The equations for (r, θ, φ) (cartesian-to-spherical) are
I don't know if there is a way to reduce that any further, but it should work.
希望这对将来的人有帮助,但是上面的答案有一个小错误。应该是:
我没有代表点在评论中发布此内容,但认为它会很有用。
Hopefully this will be helpful to someone in the future, but there is a small mistake in the above answer. It should be:
I don't have the rep points to post this in the comment, but thought it would be useful.