C++ OpenGL gluLookAt 帮助
我一直在尝试使用 gluLookAt 但遇到了一些问题...我的第一个问题是相机的默认位置是什么,每当我尝试使用它时,我的整个场景似乎横向和向上旋转... 我的第二个问题是......从我读到的内容来看,它是 gluLookAt(Posx,Posy,PosZ,yaw,pitch,roll,then 3 up 矢量),
但是偏航俯仰和滚动应该是什么顺序?
已解决
相机的默认位置为 gluLookAt(0, 0, 0, 0, 0,-1, 0, 1, 0); 感谢德鲁的所有帮助:D
I have been attempting to use gluLookAt but i have come across some issues...my first is what is the default position of the camera, whenever i try to use it, my whole scene seems to rotate sideways and up....
my second question is....from what i have read it is gluLookAt(Posx,Posy,PosZ,yaw,pitch,roll,then three up vectors)
but what order is yaw pitch and roll suppose to be in?
Solved
the default position of the camera is at gluLookAt(0, 0, 0, 0, 0,-1, 0, 1, 0);
Thanks Drew for all your help :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎获得了有关 gluLookAt() 参数的一些错误信息。从 OpenGL 2.1 在线文档中,参数应如下所示:
如您所见,没有明确提及俯仰、滚动或偏航。
另外,默认情况下,如果我没记错的话,相机位于 (0, 0, -1) ——但这并不重要,因为您几乎总是会调用 gluLookAt 并将模型视图矩阵设置为恒等式。
You seem to have gotten some bad information about the arguments to gluLookAt(). From the OpenGL 2.1 online documentation, the arguments should be as follows:
As you can see, there is no explicit mention of pitch, roll, or yaw.
Also, by default, the camera is at (0, 0, -1) if I recall correctly--but it doesn't matter since you'll almost always call gluLookAt with the modelview matrix set to the identity.