I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S

Similar documents
Section 2.3. Matrix Inverses

for all x in [a,b], then the area of the region bounded by the graphs of f and g and the vertical lines x = a and x = b is b [ ( ) ( )] A= f x g x dx

SECTION A STUDENT MATERIAL. Part 1. What and Why.?

A Primer on Continuous-time Economic Dynamics

Solids of Revolution

MCH T 111 Handout Triangle Review Page 1 of 3

Linear Algebra Introduction

SIMPLE NONLINEAR GRAPHS

Algebra 2 Semester 1 Practice Final

Proportions: A ratio is the quotient of two numbers. For example, 2 3

Matrix- System of rows and columns each position in a matrix has a purpose. 5 Ex: 5. Ex:

Numbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point

Lecture 2: Cayley Graphs

Here we consider the matrix transformation for a square matrix from a geometric point of view.

GRAND PLAN. Visualizing Quaternions. I: Fundamentals of Quaternions. Andrew J. Hanson. II: Visualizing Quaternion Geometry. III: Quaternion Frames

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

Reference : Croft & Davison, Chapter 12, Blocks 1,2. A matrix ti is a rectangular array or block of numbers usually enclosed in brackets.

Lecture 8: Abstract Algebra

Eigenvectors and Eigenvalues

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

m A 1 1 A ! and AC 6

50 AMC Lectures Problem Book 2 (36) Substitution Method

The Ellipse. is larger than the other.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

I 3 2 = I I 4 = 2A

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233,

Factorising FACTORISING.

CIT 596 Theory of Computation 1. Graphs and Digraphs

What we should know about Linear Algebra

Lecture 6: Coding theory

THREE DIMENSIONAL GEOMETRY

Comparing the Pre-image and Image of a Dilation

GM1 Consolidation Worksheet

Edexcel Level 3 Advanced GCE in Mathematics (9MA0) Two-year Scheme of Work

F / x everywhere in some domain containing R. Then, + ). (10.4.1)

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition

CS 491G Combinatorial Optimization Lecture Notes

H (2a, a) (u 2a) 2 (E) Show that u v 4a. Explain why this implies that u v 4a, with equality if and only u a if u v 2a.

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Calculus Cheat Sheet. Integrals Definitions. where F( x ) is an anti-derivative of f ( x ). Fundamental Theorem of Calculus. dx = f x dx g x dx

m m m m m m m m P m P m ( ) m m P( ) ( ). The o-ordinte of the point P( ) dividing the line segment joining the two points ( ) nd ( ) eternll in the r

The DOACROSS statement

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Logarithms LOGARITHMS.

Exercise sheet 6: Solutions

POLYGONS. Polygons PASSPORT

CARLETON UNIVERSITY. 1.0 Problems and Most Solutions, Sect B, 2005

y z A left-handed system can be rotated to look like the following. z

1.3 SCALARS AND VECTORS

THE PYTHAGOREAN THEOREM

Momentum and Energy Review

Activities. 4.1 Pythagoras' Theorem 4.2 Spirals 4.3 Clinometers 4.4 Radar 4.5 Posting Parcels 4.6 Interlocking Pipes 4.7 Sine Rule Notes and Solutions

are coplanar. ˆ ˆ ˆ and iˆ

LINEAR ALGEBRA APPLIED

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

Position Analysis: Review (Chapter 2) Objective: Given the geometry of a mechanism and the input motion, find the output motion

Mathematical Proofs Table of Contents

Lesson 2.1 Inductive Reasoning

Particle Physics. Michaelmas Term 2011 Prof Mark Thomson. Handout 3 : Interaction by Particle Exchange and QED. Recap

Grade 6. Mathematics. Student Booklet SPRING 2008 RELEASED ASSESSMENT QUESTIONS. Assessment of Reading,Writing and Mathematics, Junior Division

Green s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e

Learning Objectives of Module 2 (Algebra and Calculus) Notes:

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 )

Lesson 2.1 Inductive Reasoning

CS 360 Exam 2 Fall 2014 Name

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

In right-angled triangles the square on the side subtending the right angle is equal to the squares on the sides containing the right angle.

Let s divide up the interval [ ab, ] into n subintervals with the same length, so we have

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Introduction to Algebra - Part 2

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

2. VECTORS AND MATRICES IN 3 DIMENSIONS

Exam 1 Study Guide. Differentiation and Anti-differentiation Rules from Calculus I

STRAND J: TRANSFORMATIONS, VECTORS and MATRICES

CAMBRIDGE IGCSE MATHEMATICS Additional Practice

Uses of transformations. 3D transformations. Review of vectors. Vectors in 3D. Points vs. vectors. Homogeneous coordinates S S [ H [ S \ H \ S ] H ]

Things to Memorize: A Partial List. January 27, 2017

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

Lecture 11 Binary Decision Diagrams (BDDs)

Proving the Pythagorean Theorem

Connectivity in Graphs. CS311H: Discrete Mathematics. Graph Theory II. Example. Paths. Connectedness. Example

The Double Integral. The Riemann sum of a function f (x; y) over this partition of [a; b] [c; d] is. f (r j ; t k ) x j y k

APPENDIX. Precalculus Review D.1. Real Numbers and the Real Number Line

Ellipses. The second type of conic is called an ellipse.

Fourth Edition. Advanced. maths Harry O Brien SAMPLE

HOMEWORK FOR CLASS XII ( )

Lecture Solution of a System of Linear Equation

( ) { } [ ] { } [ ) { } ( ] { }

Now we must transform the original model so we can use the new parameters. = S max. Recruits

12.4 Similarity in Right Triangles

Unit-VII: Linear Algebra-I. To show what are the matrices, why they are useful, how they are classified as various types and how they are solved.

Total score: /100 points

Trigonometry Revision Sheet Q5 of Paper 2

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths

Calculus Module C21. Areas by Integration. Copyright This publication The Northern Alberta Institute of Technology All Rights Reserved.

ENERGY AND PACKING. Outline: MATERIALS AND PACKING. Crystal Structure

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic

Transcription:

How Are Trnsformtions Use in Computer Grphis? Ojet onstrution using ssemlies/ hierrh of prts l Skethp s msters n instnes; leves ontin primitives rolem: How to move n ojet We know how to move ojets in rel life How n we move them on omputer? Gol: move the house from here to there is ompose of hierrh ROBOT trnsformtion upper o lower o he trunk rm stnhion se there Ai to relism ojets, mer use relisti motion Help form ojet hpothesis kinestheti feek s user mnipultes ojets or sntheti mer Sntheti mer/viewing efinition normliztion Note: l with trnsformtion eplortories trnsformtion gme, hierrh pplet, mth pplets http://lolhost/~rg/illus/spplets.html here Nee: w of quntifing here n there Solution: oorinte sstem epresses spe numerill provies metri (n esrie the istne etween one point n nother) - - - - - emple: line rwn from to shows istne of Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Crtesin Coorinte Spes Emples: one, two n three imensionl rel oorinte spes R R - - - - - - - - - - - - - - - - - - - - - - Rel numers: etween n two rel numers on n is there eists nother rel numer Compre with the omputer sreen, positive integer oorinte sstem..... 8 point t (, ) norml oorinte es Anries vn Dm Septemer, 998 Trnsformtion / Z point t.. R - - - right hne oorinte sstem point t (, -, )... 8 omputer sreen es Moving n Ojet in Coorinte Sstem Now we n give quntittive instrutions for moving the house: R R here there 7 Instrution for moving: 7 8 9 9 8 7 here (, ) 7 8 9 there (7, 7) Instrution for moving: to, to Anries vn Dm Septemer, 998 Trnsformtion /

Vetors & Vetor Spe (/) Coorinte sstems n tell how fr ojets hve move, ut wht out reltionships etween the ojets? Consier ll lotions in reltionship to one entrl referene point, lle the origin 9 8 7 (8, 7.) Vetors & Vetor Spe (/) ou m hve seen vetors use in phsis lss. For emple, vetor F elow represents fore pplie to rik resting on groun F F F (, ) 7 8 9 (, ) Avetor tells ou whih iretion to go with respet to the origin, n length of the trip Nottion: olumn, or for tpogrphil resons, row [, ] for emple, the vetor pointing to the enter of the r is Brek own fore into omponents to see how muh is tull pushing the o to the right (F ) vs. how muh is pushing own (F ) Vetors re use etensivel in omputer grphis to represent positions of verties of ojets etermine orienttion of surfe in spe ( surfe norml ) rete impression of light interting with soli n trnsprent ojets (e.g., vetors from light soure to surfe) Let s use vetor n mtri nottion... Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Vetors & Vetor Spe (/) House in ompletel unstruture spe (oune retngle) D Ojet Definition (/) Lines n ollines Lines rwn etween orere points to rete more omple forms lle pollines House in oorinte spe House in vetor spe Anries vn Dm Septemer, 998 Trnsformtion 7/ Sme first n lst point mke lose polline or polgon Cn interset itself if it oes not, lle simple polgon Conve vs. Conve olgons Conve: For ever pir of points in the polgon, the line etween them is full ontine in the polgon. Conve: Not onve. So some two points in the polgon re joine line not full ontine in the polgon. Anries vn Dm Septemer, 998 Trnsformtion 8/

D Ojet Definition (/) Speil polgons D Ojet Definition (/) Cirle s polgon Informll: polgon with > sies tringle squre retngle (Aligne) ellipses A irle sle either long the or is Cirles Consist of ll points equiistnt from one preetermine point (the enter) r (rius), where is onstnt 7 7 r r 7 8 9 7 8 9 On Crtesin gri with enter of irle t origin eqution is r + Emple: height, on -is, remins while length, on -is, hnges from to Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion / D to D Ojet Definition Verties in motion ( Genertive ojet esription ) Line is rwn tring pth of point s it moves (one imensionl entit) Squre rwn tring verties of line s it moves perpeniulrl to itself (two imensionl entit) Moving Ojets with Vetors Vetor ition in R Fmilir ition of rel numers + 7 8 9 [], [], + [] Vetor ition in R Cue rwn tring pths of verties of squre s it moves perpeniulrl to itself (three-imensionl entit) Cirle rwn swinging point t fie length roun enter point olgons into polher The n prts of vetors n e e using ition of rel numers long eh of the es (omponent-wise ition) + + 7 Result, +, plotte in R is the new vetor Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Aing Vetors Visull e to, using the prllelogrm rule: tke vetor from the origin to ; reposition it so tht its strting point is t the en-point of vetor ; efine + s the en of the new vetor Slr Multiplition (/) On R, fmilir multiplition rules ( + ) 7 8 9 + On R lso or, equivlentl, to + 7 Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Slr Multiplition (/) Liner Depenene Set of ll slr multiples of vetor is line through the origin Two vetors re linerl epenent when one is multiple of the other Definition of epenene for three or more vetors is trikier Bsis vetors of the plne 7 The unit vetors (i.e., whose length is one) on the n -es re lle the stnr sis vetors of the plne The olletion of ll slr multiples of gives the first oorinte is The olletion of ll slr multiples of gives the seon oorinte is Anries vn Dm Septemer, 998 Trnsformtion / α Non-orthogonl Bsis Vetors n re perpeniulr. Neessr? Question rephrse: n we mke n vetor n m Hve from slr multiples of rnom vetors n? n m α + β Note! Doesn t work if nite sis vetors re linerl epenent. Geometri esription α + β α + β know ll vriles eept for α n β n hve two equtions, so n eue oth vlues. OK OK not OK not OK Anries vn Dm Septemer, 998 Trnsformtion /

Algeri roperties of Vetors Commuttive (vetor) Assoitive (vetor) Aitive ientit Aitive inverse Distriutive (vetor) Distriutive (slr) Assoitive (slr) + Q Q + ( + Q) + R + ( Q + R) There is vetor suh tht, for ll, ( + ) ( + ) For n there is vetor suh tht + ( ) r ( + Q) r + rq ( r + s) r + rq rs ( ) ( rs) Multiplitive ientit For n, R, The Dot rout Uses of the ot prout Define length of vetor Normlize vetors (generte vetors whose length is, lle unit vetors) Mesure ngles etween vetors Determine if two vetors re perpeniulr Fin length of projetion of vetor onto oorinte is (s in fore emple from efore) F F F Anries vn Dm Septemer, 998 Trnsformtion 7/ Anries vn Dm Septemer, 998 Trnsformtion 8/ Rule for Dot rout Also known s slr prout, orinner prout. The result is slr (i.e., numer, not vetor). Define s Emple: for n ' Not the sme s omponent-wise multiplition of rel numers ' ' + ' ' ' ( ) + ( ) + 8 Fining the Length of Vetor The ot prout of vetor with itself, ( ), is the squre of the length of the vetor: + We efine the norm of vetor (i.e., its length) to e Thus ( ) for ll, with equlit if n onl if W is lle unit vetor if W Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion /

Fining the Angle Between Two Vetors The ot prout of two non-zero vetors is the prout of their lengths n the osine of the ngle etween them: ' os( θ φ) sinθ More Uses of the Dot rout Fining the length of projetion IfW is unit vetor, then W is the length of the projetion of onto the line ontining W osθ θ (θ φ) φ θ (θ φ) φ W osθ sinθ ' ' ' ' osφ sinφ ' osθ ' osφ ' sinθ sinφ ' ( osθosφ + sinθsinφ) n, si trigonometri ientit osθ osφ + sinθsinφ os( θ φ) osθ sinθ osφ sinφ Determining right ngles erpeniulr vetors lws hve ot prout of euse the osine of 9 o is Emple: n ' ' ' ' + ' ( ) + ( ) ' ' os( 9 ) ' - - - Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Short Liner Alger Digression: Vetor n Mtri Nottion, A Non-Geometri Emple (/) A Non-Geometri Emple (/) Let s use shorthn to represent the sitution (ssuming we n rememer orer of items n orresponing pries): A more generl nottion ' ' M ' Column vetor for quntities, Q: where M,, ' M + + Row vetor for orresponing pries t the stores (): store A (Est Sie)..9.. Let s Go Shopping Nee pples, ns of soup, o of tissues, n gs of hips. Stores A, B, n C (Est Sie Mrket, Bre & Cirus, n Store) hve following unit pries respetivel pple: $. $. $.9 n soup: $.9 $.9 $. o tissues: $. $.7 $.9 g hips $. $. $. store B (B & C) store C (Store )..9.7..9..9. Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Wht o I? Let s lulte for eh of the three stores. Store A: A i Q i totlcost A i (. ) + (.9 ) + (. ) +(. ) (. +. +. +.) 8.89 Store B: Bi Q i totlcost B.9 +.7 +.7 +.8. i Store C: Ci Q i totlcost C.7 +. +.9 + 7 9. i Using Mtri Nottion We n epress these sums more omptl: ( All) totlcost A totlcost B totlcost C..9....9.7..9..9. A vetor is w of writing list, n mtri w of writing list of lists. The totlcost vetor is etermine rowolumn multiplition where row prie, olumn quntities. More generll, if two people went shopping (n were purhsing ifferent quntities of the sme items s ove) we oul epress neessr multiplitions s: mtri totlcost totlcost A A..9.. ( All) totlcost totlcost B B..9.7. totlcost totlcost C C.9..9. 8 Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Bsi Trnsformtions of the lne Vetors, n the opertions of ition, slr multiplition, n ot prout will e use to trnslte (move) rotte sle reflet sher ojets me on the omputer Trnsltion Component-wise ition of vetors ' + T where, ' ', T ' n ' + ' + To move polgons: just trnslte verties (vetors) n then rerw lines etween them reserves lengths (isometri) reserves ngles (onforml) Note: House shifts position reltive to origin Anries vn Dm Septemer, 998 Trnsformtion 7/ Anries vn Dm Septemer, 998 Trnsformtion 8/

Sling Component-wise slr multiplition of vetors ' S where, ' ', ' n ' s Rottion Rottion of vetors through n ngle θ ' R θ where, ' ', ' n ' osθ sinθ ' s ' sinθ + osθ Does not preserve lengths Does not preserve ngles (eept when sling is uniform) Note: House shifts position reltive to origin roof is oule ngle formul reserves lengths n ngles θ s s 7 8 9 9 θ Note: house shifts position reltive to the origin Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion / Sets of Liner Equtions n Mtries To trnslte, sle, n rotte vetors we nee funtion to give new vlue of, n funtion to give new vlue of Emples: for rottion ' osθ sinθ ' ( sinθ + osθ) for sling ' s Tpes of Trnsformtions rojetive ffine liner Liner: ts on line to iel either nother line or point. The vetor (, ) is lws trnsforme to (, ). Affine: preserves prllel lines. The vetor (, ) is not lws trnsforme to (, ). rojetive: prllel lines not neessril preserve, ut lines re sent to lines or points (not urves) ' s These two, ut not trnsltion, re of the form ' + ' + A trnsformtion given suh sstem of liner equtions is lle liner trnsformtion n is represente mtri: Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Some Importnt Mtries For rottion ' osθ sinθ ' sinθ + osθ n the rottion mtri is R θ For sling ' s ' s osθ sinθ sinθ osθ n the sling mtri is S s s Note tht trnsltion is not of the form ' + ' + t this point we nnot write it s mtri it is n ffine, ut not liner, trnsformtion Two Other Mtries For refletion (ross the -is) ' ' n the -is refletion mtri is RE + For shering (long the -is) ' + tnθ (θ is the sher ngle) ' n the mtri is SH θ Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Mtri-Vetor Multiplition (/) As in shopping emple Mtri-Vetor Multiplition (/) In generl: ' ' + M ' + where M,, ' ' ' n n n m m m m n n ( ) + ( ) + ( ) + + ( n n ) ( ) + ( ) + ( ) + + ( n n ) ( ) + ( ) + ( ) + + ( n n ) m ( ) + ( m ) + ( m ) + + ( m n n ) The new vetor is the ot prout of eh row of the mtri with the olumn vetor. Thus, the kth entr of the trnsforme vetor is the ot prout of the kth row of the mtri with the originl vetor. Emple: sling the vetor 7 in the iretion n. in the iretion 7. ( 7 ) + ( ) + ( ) + (. ) + n lso epress s: n i n i i M i i i n i m i i m Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Fining Mtri We n use the effet of the trnsformtion on the sis vetors n to fin the oeffiients tht mke up the trnsformtion mtri: Comining Trnsformtions The prolem with Sling n Rotting The house shifts position reltive to the origin. Not wht ou woul epet when rotting or sling n ojet. n Emple: fin the mtries tht will omplish the trnsformtions elow solutions t en of foils More nturl solution Move house to origin, then sle, (n/or rotte), then move house k to originl position Mtries performe in sequene n e ompose into single mtri Anries vn Dm Septemer, 998 Trnsformtion 7/ Anries vn Dm Septemer, 998 Trnsformtion 8/ Mtri Composition (/) Rule for omposing mtries For M, M e f, n g h M ( M ( ) ) ( M M )( ) e g f h e + f g + h, e ( + f) + g ( + h) e ( + f) + g ( + h) Mtri Composition (/) Rememering the formul: n n ( e + g) +( f + h) ( e + g) +( f + h) ( e + g) ( f + h) ( e + g) ( f + h) The prout of mtries M M is thus rete from the ot prouts of the rows of M with the olumns of M : M M e g e g f h f h α α α n α α β β β n β β Γ Γ Γ Γ Γ n Element t position (i,j) of result is the ot prout of row i of first mtri with olumn j of seon Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion /

Homogenous Coorintes Trnsltion, sling n rottion re epresse (non-homogeneousl) s: Wht is? w trnsltion: sle: + T S is projetion of h onto the w plne W rottion: R Composition is iffiult to epress, sine trnsltion not epresse s mtri multiplition Homogeneous oorintes llow ll three to e epresse homogeneousl, using multiplition mtries (, ) h ( w, w, w), w h (,, w) ( w, w, ) h ( ', ', w), w ' (, ) ---, --- ' w w W is for ffine trnsformtions in grphis So n infinite numer of points orrespon to (,, ) : the onstitute the whole line ( t, t, tw) Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Homogenous Coorinte Trnsformtions (/) For points written in homogeneous oorintes, trnsltion, sling n rottion re epresse homogeneousl s: T(, ) Ss (, s ) s s Homogenous Coorinte Trnsformtions (/) Consier R( φ) osφ sinφ sinφ osφ The sumtri olumns: re unit vetors (length) re perpeniulr (ot prout ) re vetors into whih -is n -is rotte The sumtri rows: re unit vetors re perpeniulr rotte into -is n -is These properties re rigi o n preserve lengths n ngles R( φ) osφ sinφ sinφ osφ Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Composition of D Trnsforms R( φ) rottes out the origin; to rotte out point. Trnslte to origin. Rotte. Trnslte origin k to Sle, Rotte, n Trnslte To sle, rotte n trnslte n ritrr smol out enter, ple t : Sle, rotte out point. Trnslte to origin. Sle. Rotte House t Trnsltion of to Origin φ Rottion φ Trnsltion k to Trnslte origin to Trnsltion k to osφ sinφ sinφ osφ Rottion φ Trnsltion to origin House t Trnsltion Of To Origin Sling osφ sinφ sinφ ( osφ) + sinφ osφ ( osφ) sinφ Rottion Trnsltion to Finl osition Note: these opertions re not, in generl, ommuttive euse mtri multiplition isn t: i.e., in generl M M M M Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Commuttive n Non- Commuttive Comintions of Trnsformtions in D D Bsi Trnsformtions (/) (right-hne oorinte sstem) Commuttive trnslte, trnslte sle, sle rotte, rotte sle uniforml, rotte Non-ommuttive non-uniform sle, rotte trnslte, sle rotte, trnslte Some emples of non-ommuttive trnsformtions (re is the originl, green is the trnsitionl n lue is the finl figure) Trnsltion z Sling s s s z sle, trnslte trnslte, sle rotte, ifferentil sle ifferentil sle, rotte Anries vn Dm Septemer, 998 Trnsformtion 7/ Anries vn Dm Septemer, 998 Trnsformtion 8/

D Bsi Trnsformtions (/) (right-hne oorinte sstem) Rottion out -is Rottion out -is osθ sinθ sinθ osθ osθ sinθ sinθ osθ Homogeneous Coorintes Some uses we ll e seeing lter Constrution: putting su-ojets in their prents oorinte sstem trnsforming primitives in their oorinte sstem View volume mpping D: Winow Viewport mpping D: normliztion: mpping ritrr view volume into nonil view volume long the z-is rllel (orthogrphi n olique) n perspetive projetion erspetive trnsformtion Rottion out Z-is osθ sinθ sinθ osθ Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion / So How Do We Use Trnsforms? (/) D senes re tpill store in DAG lle sene grph (or sene tree) rete lls on lirr OpenInventor JvD VRML Tpil sene grph formt ojets (ues, sphere, one, et.) with si efults (lote t the origin with unit re of volume) re store s noes in the grph other things like ttriutes (olor, teture mp, et.) n trnsformtions re lso noes in the sene grph (lele eges on pge re n strtion) n get pplie to ifferent ojet noes epening on their position in the tree For our ssignments, ou will el with muh simpler sene grph formt ttriutes of eh ojet will e store s omponent of the ojet noe (no seprte ttriute noe) trnsform noe will ffet its sutree, ut not silings trnsform noe n onl hve one hil onl lef noes re grphil ojets ll internl noes tht re not trnsform noes re group noes So How Do We Use Trnsforms? (/) In the sene grph elow, trnsformtion t will ffet ll ojets, ut t will onl ffet oj n one instne of group (whih inlues n instne of oj n oj) t oesn t ffet oj, other instne of group root group t t t group t t oj oj oj group t group ojet noes t trnsformtion noes oj group group noes Note tht if ou wnt to use multiple instnes of su-tree, suh s group ove, ou must efine it efore it s use this is so tht it s esier to implement Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Hierrhil Trnsformtion (/) Tpill, trnsformtion noes ontin t lest mtri tht hnles the trnsformtion; itionll, it m ontin iniviul trnsformtion prmeters refer to sene grph hierrh pplet Dve Krelitz (URL on p. ) To etermine the finl omposite trnsformtion mtri (CTM) for n ojet noe, ou nee to ompose ll prent trnsformtions uring prefi grph trversl et etil of how this is one vries from pkge to pkge, so e reful Hierrhil Trnsformtion (/) An emple: o m m - mtries of the trnsform noes o - ojet noes m m for o, CTM m for o, CTM m * m for o, CTM m * m * m for verte in o, its position, size n orienttion in the worl (root) oorinte sstem is : CTM * (m*m*m) * o o m m Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion / Aenum Mtri Nottion The pplition of mtries in the row vetor nottion is eeute in the reverse orer of pplition in the olumn vetor nottion: z z Column formt: vetor follows trnsformtion mtri. ' ' z' ef gh i z But, There s rolem... Notie tht while z ef gh i ef gh i z + + gz + e+ hz + f+ iz + + z + e+ fz g + h + iz Row formt: vetor preees mtri n is post-multiplie it. ''z' z ef gh i B onvention, we lws use olumn vetors. Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /

Solution to Nottionl rolem In orer for oth tpes of nottions to iel sme result, mtri in row sstem must e trnspose of mtri in olumn sstem. ef gh i in olumn nottion g eh f i Trnspose often inite, for mtri M, M T Agin, the two tpes of nottion re equivlent: in row nottion Homogeneous Coorinte Emple Trnsltion mtri with row nottion: z z Trnsltion mtri with olumn nottion: z z + + z + z + + z + z z g eh f i + + z + e + fz g + h+ iz + + z + e + fz g + h + iz ef gh i z Different tets n grphis pkges use ifferent nottions. Be reful! Anries vn Dm Septemer, 998 Trnsformtion 7/ Anries vn Dm Septemer, 998 Trnsformtion 8/ Mtri Nottion n Composition Applition of mtries in row nottion is reverse of pplition in olumn nottion: z z osθ sinθ sinθ osθ s s s osθ s s s mtries pplie right to left sinθ sinθ osθ z z mtries pplie left to right Mtri Representtion in Memor In orer to use mtries in our progrm, ou nee to estlish stnr w of storing the mtries in memor this mens ou nee to eie on w of orering the elements in our mtri There re two ommon ws of oing this lle row-mjor n olumn-mjor formt in row-mjor, the elements in row re store sequentill in memor from left to right, n the rows re store top to ottom in olumn-mjor, the elements in olumn re store sequentill in memor from top to ottom, n the olumns re store left to right Emple: Given mtri ef gh i row-mjor orering:,,,, e, f, g, h, i olumn-mjor orering:,, g,, e, h,, f, i For our ssignments, use olumn-mjor mtries Anries vn Dm Septemer, 998 Trnsformtion 9/ Anries vn Dm Septemer, 998 Trnsformtion /

Fining Mtri Solutions (/) rolem (pose on p. 7): fin mtries whih perform trnsformtions piture elow: ) ) Fining Mtri Solutions (/) We n sustitute in known vetor n its trnsforme result to solve the equtions. In this se, for instne, eomes.. Sustituting these emples gives us. + (.) + (.) Metho : Use mtri forms to etermine elements of the trnsformtion mtri. For ) we n see tht we nee sle mtri. We nee to sle long the -is; in prtiulr we nee. to eome, n. to eome. The vlues o not hnge. So the mtri woul e s o s Solve for two of the vriles, s n. Choose nother known vetor emple, n sustitute in to solve for the other two. Keep oing this until ou get unmiguous results for,,, n. Works the esiest if points re of the form n. Metho : Solve liner equtions to fin the mtri oeffiients. We know tht in generl + + Anries vn Dm Septemer, 998 Trnsformtion / Anries vn Dm Septemer, 998 Trnsformtion /