C++ OpenGL gluLookAt help

后端 未结 1 1702
长发绾君心
长发绾君心 2021-02-06 12:46

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 see

1条回答
  •  自闭症患者
    2021-02-06 12:59

    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 讨论(0)
提交回复
热议问题