开发者

C++ OpenGL gluLookAt help

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


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:

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).

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜