1 / 36

CS 4300 Computer Graphics

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 11 – September 27, 2012. Today’s Topics. Linear Algebra Review Matrices Transformations New Linear Algebra Homogeneous Coordinates. Matrices. We use 2x2, 3x3, and 4x4 matrices in computer graphics.

Download Presentation

CS 4300 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. CS 4300Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 11 – September 27, 2012

  2. Today’s Topics • Linear Algebra Review • Matrices • Transformations • New Linear Algebra • Homogeneous Coordinates

  3. Matrices • We use 2x2, 3x3, and 4x4 matrices in computer graphics. • We’ll start with a review of 2D matrices and transformations.

  4. Basic 2D Linear Transforms

  5. (1, 0) (0.5, 0) (0, 1) (0, 0.5) Scale by .5

  6. y y x x Scaling by .5

  7. y y x x General Scaling

  8. y y 1 sy x x sx 1 General Scaling

  9. φ sin(φ) cos(φ) φ Rotation -sin(φ) cos(φ)

  10. y y x x Rotation φ

  11. Reflection in y-axis

  12. y x Reflection in y-axis y x

  13. Reflection in x-axis

  14. Reflection in x-axis y y x x

  15. Shear-x s

  16. y y x x Shear x

  17. Shear-y s

  18. y y x x Shear y

  19. Linear Transformations • Scale, Reflection, Rotation, and Shear are all linear transformations • They satisfy: T(au + bv) = aT(u) + bT(v) • u and v are vectors • a and b are scalars • If T is a linear transformation • T((0, 0)) = (0, 0)

  20. Composing Linear Transformations • If T1 and T2 are transformations • T2 T1(v) =def T2(T1(v)) • If T1 and T2 are linear and are represented by matrices M1 and M2 • T2 T1 is represented by M2 M1 • T2 T1(v) = T2(T1(v)) = (M2 M1)(v)

  21. y y x x Reflection About an Arbitrary Line (through the origin)

  22. y x Reflection as a Composition

  23. Decomposing Linear Transformations • Any 2D Linear Transformation can be decomposed into the product of a rotation, a scale, and a rotation if the scale can have negative numbers. • M = R1SR2

  24. y y φ x x Rotation about an Arbitrary Point φ This is not a linear transformation. The origin moves.

  25. Translation (x, y)(x+a,y+b) y y (a, b) x x This is not a linear transformation. The origin moves.

  26. Homogeneous Coordinates y Embed the xy-plane in R3 at z = 1. (x, y)  (x, y, 1) y x x z

  27. Any 2D linear transformation can be represented by a 2x2 matrix 2D Linear Transformations as 3D Matrices or a 3x3 matrix

  28. Any 2D translation can be represented by a 3x3 matrix. 2D Linear Translations as 3D Matrices This is a 3D shear that acts as a translation on the plane z = 1.

  29. Translation as a Shear y y x x z

  30. 2D Affine Transformations • An affine transformation is any transformation that preserves co-linearity (i.e., all points lying on a line initially still lie on a line after transformation) and ratios of distances (e.g., the midpoint of a line segment remains the midpoint after transformation). • With homogeneous coordinates, we can represent all 2D affine transformations as 3D linear transformations. • We can then use matrix multiplication to transform objects.

  31. y y x x Rotation about an Arbitrary Point φ φ

  32. y φ φ φ φ x Rotation about an Arbitrary Point R(φ) T(-cx, -cy) T(cx, cy)

  33. translate (A-a,B-b) Windowing Transforms (A,B) (a,b) scale (C,D) (C-c,D-d) translate (c,d)

  34. 3D Transformations Remember: A 3D linear transformation can be represented by a 3x3 matrix.

  35. 3D Affine Transformations

  36. 3D Rotations

More Related