1 / 37

Computer Graphics

Computer Graphics. Chapter 8 3D Transformations. Transformation in 3D space. Y. Transformed Object. (x’,y’,z’). X. Z. (x,y,z). Initial Object. 3D Homogeneous Coordinates. Cartesian Homogeneous. Translation. Y. X. Z. Offset Vector = (t x , t y , t z ). Scaling About the Origin. Y.

shay
Download Presentation

Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Graphics Chapter 8 3D Transformations

  2. Transformation in 3D space Y Transformed Object (x’,y’,z’) X Z (x,y,z) Initial Object

  3. 3D Homogeneous Coordinates CartesianHomogeneous

  4. Translation Y X Z Offset Vector = (tx, ty, tz)

  5. Scaling About the Origin Y X Z Scale Factors = (sx, sy, sz)

  6. Rotation About Z-axis y y (x’,y’,z’) (x,y,z) q x x z

  7. Rotation About X-axis z y (x’,y’,z’) (x,y,z) q x y z

  8. Rotation About Y-axis x (x’,y’,z’) y (x,y,z) q x z z

  9. Rotation Matrices

  10. Reflection About XY Plane Y X Z

  11. Reflections Reflection about xy plane: Reflection about yz plane: Reflection about zx plane:

  12. 3D Affine Transformations A general invertible, linear, transformation

  13. Affine Transforms - Properties • Product of affine transformations is affine. • Affine transformations preserve linearity of segments. • Affine transformations preserve parallelism between lines. • Affine transformations are invertible.

  14. 3D Transformations - OpenGL

  15. 3D Viewing

  16. Planar Projections

  17. Projection Geometry Plane of Projection Object Point P Projector P’ Center of Projection P’ (2D) P (3D)

  18. Parallel and Perspective • Parallel Projections: • The center of projection is at infinity. • The projectors are parallel to each other. • Perspective Projections: • The center of projection is a finite point. • The projectors intersect at the center of projection.

  19. Orthographic Projection The lines of projection are parallel, and at the same time orthogonal to the plane of projection.

  20. Orthographic Projection The lines of projection are parallel, and at the same time orthogonal to the plane of projection.

  21. Orthographic Projection Projection along z axis: Transformation: x’ = x y’ = y z-coordinate information is lost! Orthographic Projection Matrix:

  22. Oblique Projection The lines of projection are parallel, but not orthogonal to the plane of projection.

  23. Oblique Projection Transformation: x’ = x+k1z y’ = y+k2z The z-coordinate value of the object point, leads to a shift of x, y coordinates of the projected point, proportional to z. Oblique Projection Matrix:

  24. Perspective Projection The projectors intersect at a Center of Projection C.

  25. Perspective Projection • For convenience of deriving projection equations, we assume that the center of projection is at the origin. • The object and the plane of projection are now on the negative z side. • The distance D then refers to the z-coordinate of the object point (towards –z). • The plane of projection has the equation z = N.

  26. Perspective Projection Perspective Projection Matrix:

  27. Perspective Projection The z-coordinate value of the object point leads to proportional scaling along x, y directions. Projections of objects located closer to the center of projection O, appear to be larger in size compared to objects that are farther away from O.

  28. Perspective Transformation a, b are arbitrary constants. The last term z’ is referred to as the pseudo-depth. Perspective Transformation Matrix:

  29. Projections: Properties • Projections map points from one space to another coordinate space of lower dimension, and hence involves loss of information. • Projections are not invertible. All projection matrices are singular. • All points on a projector map to the same point on the plane of projection.

  30. View Volumes • A view volume refers to a region of interest in three-dimensional space which will be used to generate the display on the viewport. • All points outside the view volume will not be displayed. • The shape of the view volume depends on the projection used, and the limits specified by the user.

  31. View Volume - Orthographic Projn glOrtho(left, right, bottom, top, near, far);

  32. View Volume - Orthographic Projn glOrtho(left, right, bottom, top, near, far);

  33. View Volume - Perspective Projn glFrustum(left, right, bottom, top, near, far);

  34. View Volume - Perspective Projn gluPerspective(fovy, aspect, near, far);

  35. Canonical View Volumes • The 3D object model is not actually clipped inside the projection view volume. • The view volume is instead mapped to a canonical view volume (CVV) which is a cube that extends from 1 to +1 in each dimension, having center at the origin. • The dimensions of the CVV facilitates a fast and efficient clipping.

  36. Mapping to CVV Orthographic: Perspective:

More Related