



However, the GLU library provides the gluLookAt() function, which takes an eye position, a position to look at, and an up vector, all in object space coordinates. OpenGL doesn't provide an interface to do this using a camera model. How can I move my eye, or camera, in my scene? For example to position a light source in world space it most be positioned while the viewing transformation and only the viewing transformation is applied to the MODELVIEW matrix. As a result though, certain operations must be performed when the camera and only the camera is on the MODELVIEW matrix. In practice this is mathematically equivalent to a camera transformation but more efficient because model transformations and camera transformations are concatenated to a single matrix. This is commonly referred to as the viewing transformation. To give the appearance of moving the camera, your OpenGL application must move the scene with the inverse of the camera transformation by placing it on the MODELVIEW matrix. More specifically, the camera is always located at the eye space coordinate (0.0, 0.0, 0.0). 35 How can I do my own perspective scaling?Īs far as OpenGL is concerned, there is no camera.33 How can I transform an object with a given yaw, pitch, and roll?.32 How can I transform an object so that it points at or follows another object or point in my scene?.31 Can I make OpenGL use a left-handed coordinate space?.30 How do I keep my aspect ratio correct after a window resize?.29 How do I calculate the object-space distance from the viewer to a given point?.28 How do I get the active MODELVIEW or PROJECTION matrices?.27 How do I find the coordinates of a vertex transformed only by the ModelView matrix?.26 How can I find the object-space coordinates for a pixel on the screen?.25 How can I find the screen coordinates for a given object-space coordinate?.23 How can I make a call to glFrustum() that matches my call to gluPerspective()?.22 What are the pros and cons of using glFrustum() versus gluPerspective()? Why would I want to use one over the other?.21 How do I transform my objects around a fixed coordinate system rather than the object's local coordinate system?.20 How can I draw more than one view of the same scene?.19 What are the pros and cons of using absolute versus relative coordinates?.18 How do I bypass OpenGL matrix transformations and send 2D coordinates directly for rasterization?.

17 How do I draw 2D controls over my 3D rendering?.16 How do I transform only one object in my scene or give each object its own transform?.15 How are coordinates transformed? What are the different coordinate spaces?.13 Are OpenGL matrices column-major or row-major?.12 I can't get transformations to work.10 I put my gluLookAt() call on my Projection matrix and now fog, lighting, and texture mapping don't work correctly.9 How do I get a specified point (XYZ) to appear at the center of the scene?.7 How can I automatically calculate a view that displays my entire model? (I know the bounding sphere and up vector.).6 How do I make the camera "orbit" around a point in my scene?.5 Given the current ModelView matrix, how can I determine the object-space location of the camera?.3 Where should my camera go, the ModelView or Projection matrix?.2 How can I move my eye, or camera, in my scene?.
