C++ OpenGL gluLookAt help
C++ OpenGL gluLookAt help
我一直在尝试使用gluLookAt,但我遇到了一些问题......我首先是相机的默认位置是什么,每当我尝试使用它时,我的整个场景似乎都会横向和向上旋转......我的第二个问题是....从我读到的内容来看,它是gluLookAt(Posx,Posy,PosZ,偏航,俯仰,滚动,然后是三个向上向量)
但是偏航俯仰和滚动应该是什么顺序?
解决
相机的默认位置为 gluLookAt(0, 0, 0, 0, 0,-1, 0, 1, 0);感谢德鲁的所有帮助:D
你似乎得到了一些关于gluLookAt()参数的坏信息。 从 OpenGL 2.1 在线文档中,参数应如下所示:
eyeX, eyeY, eyeZ:
World coordinates of camera location
centerX, centerY, centerZ:
World coordinates of camera aimpoint (what it's looking at).
This point will be in the center of the resulting image, assuming
that it lies between the near & far clip planes.
upX, upY, upZ:
A vector (preferrably orthogonal to the line of sight) that specifies the
roll orientation of the camera (that is, which way is "up" in the image).
如您所见,没有明确提到俯仰、滚动或偏航。
此外,如果我没记错的话,默认情况下,相机位于 (0, 0, -1) - 但这并不重要,因为您几乎总是将 gluLookAt 的模型视图矩阵设置为标识。
相关文章:
- C++ Python 中是否有类似于 help() 的函数
- 如何使用gluLookAt围绕OpenGL中的点旋转相机视图
- OpenGL gluLookAt
- 调用gluPerspective和gluLookAt给了我一个不确定的参考
- gluLookAt() 在 OpenGL 中没有效果
- glulookat() - 旋转问题
- OpenGL Glulookat不与着色器一起使用
- 意外的glulookat行为,点在opengl上抽出
- LWJGL:gluLookAt在opengl 3+中返回Matrix4f
- 旋转gluLookAt的LookAt向量
- 在glPushMatrix内外实现glulookat
- 用glulookat播放套装
- C++ help - getline
- 两个 Sphere 和 gluLookAt 函数之间的 OpenGL 碰撞
- 使用 glm::Quat(ernions) 模拟 gluLookAt
- strncat & strncpy help C++
- 在按键时更改 gluLookAt.上、右、下、左
- int to char C++ help me
- gluLookAt似乎产生了错误的观点,OpenGL
- C++ OpenGL gluLookAt help