在openGL中旋转视图?
我是 openGL 的新手,正在尝试创建一个类似鼠标的相机。
我并不是在寻找代码,而是在寻找 openGL 用于管理视图的滚动、俯仰和偏航的方法。我查看了 gluLookAt,但它看起来更多的是用于观察单个对象,而不是操纵视图。
绕 Y 轴旋转对于偏航效果很好。但是当我根据偏航绕 X 轴和 Z 轴旋转时,事情就会变得混乱。
I'm new to working with openGL and am attempting to create a mouse-look camera.
I'm not so much looking for code as much as the method openGL uses for managing roll, pitch, and yaw of the view. I checked out gluLookAt but it looks to be more for observing an individual object, rather than manipulating the view.
Rotating around the Y axis works fine for yaw. But when I rotate around X and Z based on the yaw, things go haywire.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
旋转的方法有多种,根据我个人的经验,我建议使用弧球旋转,参见这个
There are different methods for rotation, from my personal experience I would suggest arcball rotation, see this