如何使用4D转子 [英] How to use 4d rotors

查看:123
本文介绍了如何使用4D转子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建4D环境,类似于 Miegakure .

I'm trying to create a 4D environment, similar to Miegakure's.

我无法理解如何表示旋转. Miegakure的创造者写了这篇小文章,解释说他为4d转子做了一门课. http://marctenbosch.com /news/2011/05/4d-rotations-and-the-4d-quaternions/

I'm having trouble understanding how to represent rotations. The creator of Miegakure wrote this small article explaining he made a class for 4d rotors. http://marctenbosch.com/news/2011/05/4d-rotations-and-the-4d-equivalent-of-quaternions/

如何实现此类的功能?尤其是旋转矢量和其他转子并获得逆?的功能.

How can I implement the functions of this class ? In particular the functions to rotate vectors and other rotors, and getting the inverse ?

我会喜欢一些伪代码示例. 非常感谢任何愿意回答的人.

I would appreciate some pseudocode examples. Thanks a lot to anyone who bothers answering.

推荐答案

解决围绕任意矢量的旋转会使您在 4D 中疯狂.是的,那里有一些方程式,例如将3D旋转扩展到4D的Euler-Rodrigues公式,但是所有这些都需要求解方程组,在 4D 中,它的使用对于我们来说确实不直观.

Solving rotation around arbitrary vector will make you insane in 4D. Yes there are equations for that out there like The Euler–Rodrigues formula for 3D rotations expansion to 4D but all of them need to solve system of equations and its use is really not intuitive for us in 4D.

我使用的是平行于平面的旋转(类似于 3D 中围绕主轴的旋转)在 4D 中有6个XY,YZ,ZX,XW,YW,ZW,因此只需创建旋转矩阵(类似于 3D ).我对 4D使用 5x5均匀变换矩阵,所以旋转看起来像这样:

I am using rotation parallel to planes instead (similar to rotations around main axises in 3D) In 4D there are 6 of them XY,YZ,ZX,XW,YW,ZW so just create rotation matrices (similar to 3D). I am using 5x5 homogenuous transform matrices for 4D so the rotations looks like this:

xy: 
( c , s ,0.0,0.0,0.0)
(-s , c ,0.0,0.0,0.0)
(0.0,0.0,1.0,0.0,0.0)
(0.0,0.0,0.0,1.0,0.0)
(0.0,0.0,0.0,0.0,1.0)
yz: 
(1.0,0.0,0.0,0.0,0.0)
(0.0, c , s ,0.0,0.0)
(0.0,-s , c ,0.0,0.0)
(0.0,0.0,0.0,1.0,0.0)
(0.0,0.0,0.0,0.0,1.0)
zx:
( c ,0.0,-s ,0.0,0.0)
(0.0,1.0,0.0,0.0,0.0)
( s ,0.0, c ,0.0,0.0)
(0.0,0.0,0.0,1.0,0.0)
(0.0,0.0,0.0,0.0,1.0)
xw:
( c ,0.0,0.0, s ,0.0)
(0.0,1.0,0.0,0.0,0.0)
(0.0,0.0,1.0,0.0,0.0)
(-s ,0.0,0.0, c ,0.0)
(0.0,0.0,0.0,0.0,1.0)
yw:
(1.0,0.0,0.0,0.0,0.0)
(0.0, c ,0.0,-s ,0.0)
(0.0,0.0,1.0,0.0,0.0)
(0.0, s ,0.0, c ,0.0)
(0.0,0.0,0.0,0.0,1.0)
zw:
(1.0,0.0,0.0,0.0,0.0)
(0.0,1.0,0.0,0.0,0.0)
(0.0,0.0, c ,-s ,0.0)
(0.0,0.0, s , c ,0.0)
(0.0,0.0,0.0,0.0,1.0)

其中c=cos(a),s=sin(a)a是旋转角度.旋转轴穿过坐标系原点(0,0,0,0).有关更多信息,请查看以下内容:

Where c=cos(a),s=sin(a) and a is angle of rotation. The rotation axis goes through coordinate system origin (0,0,0,0). For more info take a look at these:

  • Understanding 4x4 homogenous transform matrices mine 3D math
  • 4D rendering techniques mine C++ 4D render
  • Visualising 4D objects in OpenGL older QAs
  • 4D to 3D perspective projection older QAs
  • Four-Space Visualization of 4D Objects this is the most comprehensive stuff on the topic I found read it !!!

这篇关于如何使用4D转子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆