Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coordinate Systems Lecture 20 Wed, Oct 15, 2003. Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.

Similar presentations


Presentation on theme: "Coordinate Systems Lecture 20 Wed, Oct 15, 2003. Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally."— Presentation transcript:

1 Coordinate Systems Lecture 20 Wed, Oct 15, 2003

2 Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally the origin of an object is placed at a convenient point. Sphere – at the center. Rectangular box – at the center or at a corner. Cone – at the center of the base or at the vertex.

3 Model Coordinates The entire scene, including all of its objects, is drawn in model coordinates. The origin of the scene is placed at a convenient point.

4 Model Coordinates In most cases, the local origins of the various objects are not the same as the origin of the model. The objects must be moved to their proper locations relative to the model’s origin. This is done using translations, rotations, etc.

5 Camera (Eye) Coordinates The camera has its own coordinate system. The camera is located at the origin. It is facing the negative z-direction. It’s “up” direction is in the positive y- direction.

6 Camera (Eye) Coordinates To “move” the camera is to apply transformations to the entire scene. This puts the scene in camera, or eye, coordinates. In other words, it is the scene that is moved, not the camera.

7 Camera (Eye) Coordinates Given that the scene already contains a number of transformations that place the individual objects, where should the camera transformations be done in order to move the entire scene?

8 Example CameraMover.cpp mesh.cpp Comment out the gluLookAt() function call. Replace it with  glTranslatef(0, 0, -eyeDist);  glRotatef(eyePitch, 1, 0, 0);  glRotatef(-eyeYaw, 0, 1, 0);

9 Device Coordinates Once the scene is in camera coordinates, it is then transformed into device coordinates: -1  x  1 -1  y  1 -1  z  1. Now the volume is a cube, 2 units on a side, centered at the origin.

10 Device Coordinates This transformation is not an isometry. Angles are not preserved. Distances are not preserved. Foreshortening occurs.

11 Device Coordinates Then the contents of the cube are clipped by the six sides of the cube. Why now?

12 Device Coordinates Also, hidden surfaces are removed in device coordinates. Why now?

13 Window Coordinates Device coordinates are projected onto the 2-dimensional window coordinate system. This is done (conceptually) in two stages: (x, y, z)  (x, y) (orthographic) (x, y)  ((x + 1)/2*w, (y + 1)/2*h), where w and h are the screen width and height.

14 The Graphics Pipeline In the graphics pipeline, what takes place between application of the modelview matrix and application of the projection matrix? What takes place between application of the projection matrix and conversion to window coordinates? When does rasterization occur?


Download ppt "Coordinate Systems Lecture 20 Wed, Oct 15, 2003. Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally."

Similar presentations


Ads by Google