Download Matrix Composition - Introduction to Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!
Lecture 11:
Viewing 1
Refresher
โข Matrix composition:
โ If I want to have an object thatโs currently located at
position (a, b, c) to be
- Uniformly scaled by 3
- Rotated around the z-axis by 45 degrees
- Translated by (5, 10, 15)
โ Write out the sequence of matrices that you need to
apply
โข Now write out the inverse of this transformation
matrix
Composition (an example) (2D) (2/2)
- ๐ปโ๐๐น๐บ๐ป
But what if we mixed up the order? Letโs try ๐น๐ปโ๐๐บ๐ป
cos90 โ๐ ๐๐90 0 ๐ ๐๐90 ๐๐๐ 90 0 0 0 1
1 0 2 0 1 2 0 0 1
3 0 0 0 3 0 0 0 1
1 0 โ 0 1 โ 0 0 1
- Oops! We managed to scale it properly but when we rotated it we rotated the object about the origin, not its own center, shifting its positionโฆ Order Matters!
- http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/appl ets/transformationGame/transformation_game_guide.html (Transformations applet)
Rotating axis by axis (1/2)
- Every rotation can be represented as the composition of 3 different angles of
CLOCKWISE rotation around 3 axes, namely
- ๐ฅ-axis in the ๐ฆ๐ง plane by ๐
- ๐ฆ-axis in the ๐ฅ๐ง plane by ๐
- ๐ง-axis in the ๐ฅ๐ฆ plane by ๐
- Also known as Euler angles, makes the problem of rotation much easier to
deal with
- ๐น๐๐ : rotation around the ๐ฅ axis, ๐น๐๐ : rotation about the ๐ฆ axis,
๐น๐๐ : rotation about the ๐ง axis
- You can compose these matrices to form a composite rotation matrix
๐
๐ฅ๐ฆ(๐) ๐
๐ฆ๐ง ๐^ ๐
๐ฅ๐ง ๐
Rotation
- Rotation by angle ๐ around vector ๐ =
๐๐ ๐๐ ๐๐
- Hereโs a not so friendly rotation matrix:
๐ค๐ฅ^2 + ๐๐๐ ๐(๐ค๐ฆ^2 + ๐ค๐ง^2 ) ๐ค๐ฅ๐ค๐ฆ 1 โ ๐๐๐ ๐ + ๐ค๐ง๐ ๐๐๐ ๐ค๐ฅ๐ค๐ง 1 โ ๐๐๐ ๐ + ๐ค๐ฆ๐ ๐๐๐ 0 ๐ค๐ฅ๐ค๐ฆ 1 โ ๐๐๐ ๐ + ๐ค๐ง๐ ๐๐๐ ๐ค๐ฆ^2 + ๐๐๐ ๐(๐ค๐ฅ^2 + ๐ค๐ง^2 ) ๐ค๐ง๐ค๐ฆ 1 โ ๐๐๐ ๐ โ ๐ค๐ฅ๐ ๐๐๐ 0 ๐ค๐ฅ๐ค๐ง 1 โ ๐๐๐ ๐ โ ๐ค๐ฆ๐ ๐๐๐ ๐ค๐ง๐ค๐ฆ 1 โ ๐๐๐ ๐ + ๐ค๐ฅ๐ ๐๐๐ ๐ค๐ง^2 + ๐๐๐ ๐(๐ค๐ฆ^2 + ๐ค๐ฅ^2 ) 0 0 0 0 1
- This is called the coordinate form of Rodriguesโs formula
How to Invert a Matrix
- Weโre going to use Gauss-Jordan elimination
- Finding A-1^ with Gauss-Jordan elimination is done by augmenting A with I
to get [A|I], then reducing the new matrix into reduced row echelon form
(rref) to get a new matrix. This new matrix will be of the form [I|A-1]
- What does rref really mean?
- If a row does not consist entirely of zeros, then the first nonzero number in the row is a
- (Call this a leading 1)
- If there are any rows that consist entirely of zeros, then they are grouped together at the bottom of the matrix.
- If any two successive rows do not consist entirely of zeros, the leading 1 in the lower row occurs farther to the right than the leading 1 in the higher row
- Each column that contains a leading 1 has zeros everywhere else.
How to Invert a Matrix, Example
, letโs find ๐ดโ1:
1. Augment this with the identity:
2. Row operation 1: multiply row 1 by 1/
13 11 19
1 11 0
3. Row operation 3: multiply row 1 by -17 and add it to row 2:
13 11 โ
12 11
1 11 โ
17 11
How to Invert a Matrix, Example
4. Row operation 1, multiply row 2 by โ 11/
13 11 1
1 11 17 12
11 12
5. Row operation 3: multiply row 2 by โ 13/11 and add to row 1
17 12
13 12 โ
11 12
6. Therefore:
โ ๐ดโ1^ =
17 12 โ^
11 12
Drawing as Projection (Turning 3D to
2D)
- Painting based on mythical tale as told by Pliny
the Elder: Corinthian man traces shadow of departing lover
๏ฝ Detail from: The Invention of Drawing (1830) Karl Friedrich Schinkle (Mitchel p.1)
๏ฝ Projection through use of
shadows
Early Forms of Projection
โข Plan view ( parallel ,
specifically orthographic,
projection) from
Mesopotamia (2150 BC):
Earliest known technical
drawing in existence
โข Greek vase from the late 6th
century BC: Shows signs of
attempts at perspective!
- Note relative sizes of thighs
and lower legs of minotaur
Linear Perspective
โข Parallel lines converse (in 1, 2, or 3 axes) to
vanishing point(s).
โข Objects farther away are more foreshortened
(i.e., smaller) than closer ones
edges same size, with farther ones smaller
parallel edges converging
๏ฝ Example: perspective cube
Early Attempts at Perspective
- In art, an attempt to represent 3D space more realistically
- Earlier works invoke a sense of 3D space but not systematically
Background for Inventing Perspective
Projection
- Starting in the 13th^ century (AD): New emphasis on
importance of individual viewpoint, world interpretation, power of observation (particularly of nature: astronomy, anatomy, etc)
- Massaccio
- Donatello
- Leonardo
- Newton
๏ฝ Universe as clockwork: rebuilding the universe more
systemically and mechanically
Ender, Tycho Brahe and Rudolph II in Prague (detail of clockwork), c. 1855
Brunelleschi and Vermeer
- Brunelleschi invented systematic method of determining perspective
projections (early 1400โs). He created demonstration panels with specific
viewing constraints for complete accuracy of reproduction. Note the
perspective is accurate only from one Point of View (POV)
- Vermeer created perspective boxes where picture, when viewed through
viewing hole, had correct perspective
Perspective Box Samuel van Hoogstraten National Gallery, London
Perspective Box of a Dutch Interior Samuel van Hoogstraten National Gallery, London
๏ฝ Vermeer on the web: ๏ฝ http://www.grand-illusions.com/articles/ mystery_in_the_mirror/ ๏ฝ http://essentialvermeer.20m.com/ ๏ฝ http://brightbytes.com/cosite/what.html