Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coordinate Systems Lecture 1 Fri, Sep 2, 2005. The Coordinate Systems The points we create are transformed through a series of coordinate systems before.

Similar presentations


Presentation on theme: "Coordinate Systems Lecture 1 Fri, Sep 2, 2005. The Coordinate Systems The points we create are transformed through a series of coordinate systems before."— Presentation transcript:

1 Coordinate Systems Lecture 1 Fri, Sep 2, 2005

2 The Coordinate Systems The points we create are transformed through a series of coordinate systems before being drawn on the screen. Model coordinates World coordinates Eye coordinates Clip coordinates Normalized device coordinates Viewport coordinates Screen coordinates

3 Changing Coordinate Systems In most cases, we change from one coordinate system to another by using a linear transformation. A linear transformation is a function that can be described by matrix multiplication. X' = AX.

4 Affine and Projective Transformations A linear transformation always maps lines to lines, i.e., collinear points to collinear points. An affine linear transformation always maps Parallel lines to parallel lines. Intersecting lines to intersecting lines. A projective linear transformation may map Parallel lines to intersecting lines. Intersecting lines to parallel lines.

5 Model Coordinates An object is first drawn in model coordinates. This is a coordinate system that is local to the object. The origin and the axes are selected for convenience relative to that object.

6 Examples Sphere Place the origin at the center of the sphere. Cube Place the origin at one corner. Place the adjacent corners on the positive x-, y-, and z-axes. Cone? Cylinder?

7 Model Coordinates for a Cube Read Run

8 World Coordinates The world coordinate system is the system of coordinates used for building the 3-D scene in a single unified model. The origin and axes are chosen for convenience.

9 Example Imagine a scene with five cubes spaced out in a row. Each cube has its own model coordinate system. There is only one world coordinate system.

10 Five Cubes in a Row Read Run

11 World Coordinates Linear transformations are used to move the objects from their local coordinate systems to the world coordinate system. Translations Rotations Reflections Scalings

12 Eye Coordinates In the eye coordinate system, the viewpoint, or “eye,” or “camera” is Located at the origin. Looking down the negative z-axis.

13 The Eye Coordinate System x y z Eye Direction of view

14 Eye Coordinates Linear transformations are used to move the eye from the origin to the desired viewing position in world coordinates. Translations Rotations Actually, it is the inverse of this transformation that is applied to transform the objects from world coordinates to eye coordinates.

15 The View Frustum The view frustum is a truncated rectangular pyramid with vertex at the eye and bases parallel to the line of sight. It is bounded by six planes. The left and right planes. The top and bottom planes. The near and far planes.

16 The View Frustum Read Run

17 The View Frustum The view frustum represents that part of the scene that will be visible on the computer screen. For technical reasons, the near and far planes eliminate objects that are either too near or too far away.

18 The View Frustum Transformed Read Run

19 Clip Coordinates Eye coordinates are transformed to clip coordinates by another linear transformation. It transforms the view frustum into sort of a cube. This transformation distorts angles and distances. In clip space, the GPU “clips” all objects, removing objects or parts of objects that are outside of the view frustum.

20 Normalized Device Coordinates The view frustum is like a distorted cube. The transformation to clip coordinates followed by the perspective division, transforms the view frustum into a perfect cube. This coordinate system is called normalized device coordinates. This transformation is less intuitive; we will learn the details later.

21 Normalized Device Coordinates The cube is centered at the origin. Each dimension ranges from -1 to 1. -1  x  1 -1  y  1 -1  z  1

22 Normalized Coordinates x y z

23 Viewport Coordinates The coordinate system of the drawing region on the 2-D screen is the viewport coordinate system. The origin (0, 0) is the lower left corner. Increasing x is to the right. Increasing y is up.

24 Viewport Coordinates (0, 0) x y (x, y)

25 Window Coordinates The window coordinate system is like the screen coordinate system, except that The origin is in the upper left corner. Increasing y is down.

26 Window Coordinates (0, 0) x y The viewport within the window (x, y)

27 Window Coordinates Normally, the viewport will fill the window. Thus, the x-coordinates will be the same. x view = x window The y-coordinates will run in opposite directions. y view = screen height – y window


Download ppt "Coordinate Systems Lecture 1 Fri, Sep 2, 2005. The Coordinate Systems The points we create are transformed through a series of coordinate systems before."

Similar presentations


Ads by Google