四元数旋转opengl
如果我制作一个四元数
,它代表例如玩家的方向和围绕该旋转的角度。因此,对于该应用程序,我打算让飞机飞行。四元数代表玩家的方向和围绕该方向的角度。
然后我的问题是如何旋转程序中的对象,我是否将玩家四元数转换为矩阵,然后用 glMultMatrix 来转换?
如果这一切都很好,有人可以发布我的理论是否正确,如果没有,可以发布给我一个可供阅读的源材料或一些关于我应该做什么的好理论。
If i make a quaternion
which represents for example a players direction and the angle around this rotation. So for the application I intend to make a plane flying. The quaternion would represent the players direction and the angle around this direction.
Then my question is how do I rotate the object in the program do I convert the players quaternion to a matrix then glMultMatrix this with this?
If this is all good can someone post if my theory is correct and if not post me a source material to read or some good theory for what I should do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望我正确理解这个问题。
是的,单位长度四元数表示方向,可以将其解释为轴角度对。从轴角生成四元数很简单。
是的,这是一种方法。
这是关于数学背后的很好的资源(包括解释和方程):
http: //content.gpwiki.org/index.php/OpenGL:教程:使用_Quaternions_to_represent_rotation
I hope I understand the question correctly.
Yes, an unit-length quaternion represents an orientation, which can be interpreted as an axis-angle pair. It's simple to make a quaternion from axis-angle.
That's one way to do it, yes.
This is a good resource on the mathematics behind (both the explanation and equations):
http://content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation