Coordinate Systems. Things to think about:

Similar documents
Diagonalization of Quadratic Forms. Recall in days past when you were given an equation which looked like

Elementary Linear Algebra

Introduction. Question: Why do we need new forms of parametric curves? Answer: Those parametric curves discussed are not very geometric.

U8L1: Sec Equations of Lines in R 2

U8L1: Sec Equations of Lines in R 2

Image Spaces. What might an image space be

FAILURE CRITERIA: MOHR S CIRCLE AND PRINCIPAL STRESSES

Apply change-of-basis formula to rewrite x as a linear combination of eigenvectors v j.

Problem Cosider the curve give parametrically as x = si t ad y = + cos t for» t» ß: (a) Describe the path this traverses: Where does it start (whe t =

Fundamental Concepts: Surfaces and Curves

too many conditions to check!!

Polynomial Functions and Their Graphs

Linear Transformations

Lecture 7: Polar representation of complex numbers

Most text will write ordinary derivatives using either Leibniz notation 2 3. y + 5y= e and y y. xx tt t

Balancing. Rotating Components Examples of rotating components in a mechanism or a machine. (a)

Session 5. (1) Principal component analysis and Karhunen-Loève transformation

CHAPTER 8 SYSTEMS OF PARTICLES

CALCULUS BASIC SUMMER REVIEW

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

Infinite Sequences and Series

Notes The Incremental Motion Model:

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics

a is some real number (called the coefficient) other

Section 1.1. Calculus: Areas And Tangents. Difference Equations to Differential Equations

( ) ( ) ( ) notation: [ ]

Chapter 10: Power Series

CS 112 Transformations II. Slide 1

Orthogonal transformations

Bivariate Sample Statistics Geog 210C Introduction to Spatial Data Analysis. Chris Funk. Lecture 7

Representing transformations by matrices

3 Balance equations ME338A CONTINUUM MECHANICS

Tennessee Department of Education

LINEARIZATION OF NONLINEAR EQUATIONS By Dominick Andrisani. dg x. ( ) ( ) dx

R is a scalar defined as follows:

PH 425 Quantum Measurement and Spin Winter SPINS Lab 1

Two or more points can be used to describe a rigid body. This will eliminate the need to define rotational coordinates for the body!

Chimica Inorganica 3

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

Honors Calculus Homework 13 Solutions, due 12/8/5

C/CS/Phys C191 Deutsch and Deutsch-Josza algorithms 10/20/07 Fall 2007 Lecture 17

REVISION SHEET FP1 (MEI) ALGEBRA. Identities In mathematics, an identity is a statement which is true for all values of the variables it contains.

Partial Differential Equations

Chapter 2 Feedback Control Theory Continued

A NOTE ON THE TOTAL LEAST SQUARES FIT TO COPLANAR POINTS

6.3 Testing Series With Positive Terms

+ve 10 N. Note we must be careful about writing If mass is not constant: dt dt dt

The Random Walk For Dummies

Principle Of Superposition

Math E-21b Spring 2018 Homework #2

REVISION SHEET FP1 (MEI) ALGEBRA. Identities In mathematics, an identity is a statement which is true for all values of the variables it contains.

A widely used display of protein shapes is based on the coordinates of the alpha carbons - - C α

II. Descriptive Statistics D. Linear Correlation and Regression. 1. Linear Correlation

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Statistics 511 Additional Materials

HWA CHONG INSTITUTION JC1 PROMOTIONAL EXAMINATION Wednesday 1 October hours. List of Formula (MF15)

Notes on iteration and Newton s method. Iteration

Math 21B-B - Homework Set 2

ES.182A Topic 40 Notes Jeremy Orloff

Notes for Lecture 5. 1 Grover Search. 1.1 The Setting. 1.2 Motivation. Lecture 5 (September 26, 2018)

Chapter 6 Part 5. Confidence Intervals t distribution chi square distribution. October 23, 2008

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Definition 2.1 (The Derivative) (page 54) is a function. The derivative of a function f with respect to x, represented by. f ', is defined by

Lecture 7: Fourier Series and Complex Power Series

Axis Aligned Ellipsoid

Salmon: Lectures on partial differential equations. 3. First-order linear equations as the limiting case of second-order equations

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

Problem Set # 5 Solutions

EE2 Mathematics : Functions of Multiple Variables

1 Approximating Integrals using Taylor Polynomials

Taylor Series (BC Only)

CATHOLIC JUNIOR COLLEGE General Certificate of Education Advanced Level Higher 2 JC2 Preliminary Examination MATHEMATICS 9740/01

Machine Learning for Data Science (CS 4786)

Introduction to Machine Learning DIS10

AP Calculus BC Review Applications of Derivatives (Chapter 4) and f,

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

Roberto s Notes on Series Chapter 2: Convergence tests Section 7. Alternating series

MATHEMATICS: PAPER II Page 1 of 11 HILTON COLLEGE TRIAL EXAMINATION AUGUST 2013 MATHEMATICS: PAPER II GENERAL INSTRUCTIONS

Mth 95 Notes Module 1 Spring Section 4.1- Solving Systems of Linear Equations in Two Variables by Graphing, Substitution, and Elimination

Some examples of vector spaces

NATIONAL JUNIOR COLLEGE SENIOR HIGH 1 PROMOTIONAL EXAMINATIONS Higher 2

8. Applications To Linear Differential Equations

Representations of State Vectors and Operators

Measures of Spread: Standard Deviation

Simple Linear Regression

In the preceding Chapters, the mathematical ideas underpinning the quantum theory have been

4.3 Growth Rates of Solutions to Recurrences

Now we are looking to find a volume of solid S that lies below a surface z = f(x,y) and R= ab, cd,,[a,b] is the interval over

Chapter 1. Complex Numbers. Dr. Pulak Sahoo

MEI Casio Tasks for Further Pure

Section 14. Simple linear regression.

Math 21C Brian Osserman Practice Exam 2

Castiel, Supernatural, Season 6, Episode 18

Lecture 9: Vector Geometry: A Coordinate-Free Approach. And ye shall know the truth, and the truth shall make you free. John 8:32

An application of a subset S of C onto another S' defines a function [f(z)] of the complex variable z.

Quadratic Functions. Before we start looking at polynomials, we should know some common terminology.

Implicit function theorem

, then cv V. Differential Equations Elements of Lineaer Algebra Name: Consider the differential equation. and y2 cos( kx)

Transcription:

Coordiate Sstems There are 3 coordiate sstems that a compter graphics programmer is most cocered with: the Object Coordiate Sstem (OCS), the World Coordiate Sstem (WCS), ad the Camera Coordiate Sstem (CCS). Each plas a importat role. OCS: Objects are most easil modeled i a coordiate sstem with the origi at its ceter ad the coordiate aes aliged i some atral wa with the object. For eample, the sides of a cbe wold be aliged with the coordiate aes. Each object will hae its ow OCS. WCS: I order for objects to iteract, we eed to place all objects withi a sigle coordiate sstem, called the WCS, so their relatioship with ca be epressed. We thik of the WCS as represetig the eiromet i which eerthig eists. Commol, the WCS origi establishes the leel of the grod ad the ais poitig p. The WCS is tpicall cosidered fied i positio oer time (objects ad camera moe withi the WCS). The model matri, M, coerts a object s ertices epressed i OCS to the WCS. Each object will hae its ow M. We se the cocept of scee graphs to geerate the model matri M i order to place ad moe comple objects withi the WCS. CCS: The camera represets the locatio & orietatio of the iewer. Oer time, the iewer geerall moes arod the WCS ad so the relatioship betwee the CCS ad WCS is ot costat. The process of rederig a image reqires that a 3D scee (i.e. the ertices) be projected dow oto a 2D scree (the image), where the locatio ad orietatio of the scree is defied b the camera. The projectio is simple to do if the ertices are epressed i the camera coordiates, i.e. with the camera at the origi ad lookig dow the egatie ais (as is the case for the CCS), the the projectio will be oto to the plae so that the projectio is simpl (,,) (, ). Ths, we trasform ertices from the WCS to the CCS i order to simplif the projectio calclatio. Thigs to thik abot: Whe specifig the coordiates of a positio, it is importat to make it clear which coordiates sstem is beig sed. Cosider the poit (,,) T. This will mea somethig differet depedig o which coordiate sstem oe is i. For eample, i the OCS, the (,,) T geerall correspods to the ceter of the object. I the WCS, (,,) T correspods to the origi of the world, ad i CCS, (,,) T correspods to the locatio of the camera. Similarl, the ector (,,) T correspods to the ais. The ais i the WCS is ot i the same directio as the ais i the CCS. I geeral, a poit P ca be epressed i a of the coordiate sstems. This will be discssed more later.

Trasformig OCS WCS Cosider a cbe which might be modeled i the OCS as i Figre. Figre : A cbe i OCS. Figre 2: A cbe as it appears i OCS ad WCS Let P be a poit o a cbe sch as the erte at coordiates (.5,.5,.5) T i OCS. Now sppose we wat to place it ito the world as show i Figre 2. To do this, we eed to trasform the coordiates sig a matri we call the Model Matri, M. P WCS = ' ' = M P OCS = M ' Where M is determied sig the scee graph techiqes. WCS CCS Gie the cbe i WCS, we ca ow trasform it ito the CCS as show i Figre 3. All three coordiate sstems are show i Figre 4. Figre 3: A cbe as it appears i WCS ad CCS Figre 4: A cbe i relatio to OCS, WCS, ad CCS Notice that i the CCS the camera alwas looks dow the camera s egatie ais ad the ector poits perpediclarl p from the camera. To determie the coordiates i the CCS, we eed to trasform it from WCS to CCS sig a matri trasform which we call the View Matri, V. '' ' P CCS = '' = V P WCS = V ' = V M P OCS = V M '' '

Note: For eample, the poit P=(.5,.5,.5) T o the cbe as epressed i CCS is.5 P CCS = V P WCS = V M P OCS = V M.5..5 Relatioship betwee Trasformig Poits ad Trasformig Coordiate Sstems Before discssig how to calclate V, we eed to discss trasformatios of coordiate sstems. Note that it is ot possible to distigish betwee traslatig a poit P i a coordiate sstem erss keepig the poit fied bt moig the coordiate aes as show i Figre 5 below. We preset the cocepts here i 2D, howeer, the reslts eted to 3D. Figre 5: Moig the coordiate sstem (left) s moig the poit (right) The relatioship betwee P ad Q (o left) is the same as the relatioship betwee P ad Q (o right): O the left, the poit P has coordiates (,3) i Q. We traslate the coordiate aes i Q b (4,3) to obtai Q. Epressed i Q, P ow has coordiates (-3,). O the right, we keep Q fied bt traslate P=(,3) b (-4,-3) to that it is ow sittig at P =(-3,). Either wa, P eds p at (-3,) ad the trasformatio that mst be applied to the poit (o right) is the ierse of that applied to the coordiate sstem (o left). I smmar, traslatig a poit b a traslatio T, is eqialet to traslatig the coordiate sstem b T - = ierse of T. Figre 5: Rotatig the coordiate sstem (left) s rotatig the poit (right)

Similarl, it ca be show that rotatig a poit b the rotatio R, is eqialet to rotatig the coordiate sstem b R - = ierse of R. I geeral, a trasformatio A applied to the coordiate aes is eqialet to applig the trasformatio A - to the ertices. For eample, sppose we appl both a rotatio ad traslatio to the coordiate aes: A=TR. This is eqialet to trasformig the ertices b A - = (TR) - = R - T -. We will make se of this reslt i the et sectio. Calclatig V Recall that V is the matri which trasforms ertices i WCS to ertices i CCS. To calclate V, will first cosider the trasformatios ecessar to do the eqialet trasform of the coordiates aes. Namel, we wat to fid the matri trasform, TR, cosistig of a traslatio T ad rotatio R, which will moe the WCS to the CCS. Followig the reslt of the preios sectio, V will the be the ierse of this, amel, V = R - T -. Sppose the camera s positio i the WCS is gie b the ee ector ee ee = ee. ee The camera s orietatio ca be defied b the three orthogoal it ectors,, ad defied i the WCS, where the camera looks i the directio of, ad where is perpediclarl p ad is to the camera s right. Note: If the WCS ad CCS were eactl aliged, the wold correspod to the ais, wold correspod to the ais, ad wold correspod to the ais. The locatio ad orietatio of the camera is completel determied b ee,,, ad. We se these to determie the trasforms TR which moe the WCS to the CCS. We first appl the rotatio, ad the the traslatio. Figre 6: Trasformig the aes.

I Figre 6, we begi with the WCS ad CCS aliged as o the left. We first rotate b R (middle) ad the traslate b T (right). It is eas to see that T = ee ee ee R is less obios. Whateer R is, it mst satisf the eqatios (see middle of Figre 6): = R, = R, ad = R I homogeeos coordiates, we hae =, =, =, =, =, = Note, the 4 th compoet of each is becase these are ectors ad ot poits! So the aboe eqatios become = = R, = = R, ad = = R The ol matri R which satisfies all three of these eqatios is the matri whose colms are,, (we are relig o the fact that,, ad are orthoormal ectors): R = Gie R ad T, we ca ow calclate V: V = R - T - = R T T - = ee ee ee = ee ee ee ee ee ee ee ee ee I the code, we store the positio of the ee = (ee, ee,ee,)

Ad the iew rotatio matri V rot = R -. Order of Trasformatios: Thigs to Thik Abot We ow kow how to calclate V ad ths how to trasform poits from OCC to WCS to CCS. P CCS = V P WCS = V M P OCS Thik abot the followig Do the make sese to o? P OCS = (,,,) T correspods to the ceter of the object P WCS = (,,,) T correspods to the ceter of the world P CCS = (,,,) T correspods to the ceter of the camera V (,,,) T gies the locatio of the world origi i the camera coordiate sstem V M (,,,) T gies the locatio of the object s ceter i the camera coordiate sstem M (,,,) T gies the locatio of the object s eter i the world coordiate sstem Now sppose we hae the stadard rotatio matri R abot the -ais, that is cosθ siθ R = siθ cosθ The order i which R is applied has a big differece o what happes, as follows: V M R P OCS V R M P OCS R V M P OCS rotates a erte P OCS abot the object s ais rotates a erte P OCS abot the world s ais rotates a erte P OCS abot the camera s ais Tmble The tmble trasformatio chages the iew trasform V as follows: We specif a P c = ceter of iterest. This ca be awhere bt i the code we limit it to be either the WCS origi or a poit a fied distace i frot of the camera. Moig the mose left ad right will rotate the camera abot the lie which goes throgh P c ad is parallel to the WCS -ais Moig the mose p ad dow will rotate the camera abot the lie which goes throgh P c ad is parallel to the camera s ais Defie the followig matrices: The matri A rotates alog the lie which goes throgh a poit P ad is parallel to the -ais A = T(P) R T(-P)

where we se the otatio T(P) to idicate a traslatio b a amot P. We wat A to be applied i the WCS so it mst mltipl V o the right. The poit P correspods to the poit of iterest P c which is epressed i WCS. The matri B rotates alog the lie which goes throgh a poit P ad is parallel to the -ais. B = T(P) R T(-P) We wat B applied i the CCS so we mst mltipl V b B o the left. The poit P correspods to the poit of iterest P c which ow mst be epressed i CCS, i.e. P c = V old P c Ths, to tmble the camera, we hae the ew iew matri to be V ew = B V old A = T(P c ) R T(-P c ) V old T(P c ) R T(-P c ), where P c = V old P c I the code, we do ot store V bt rather the V rot = rotatioal part of V, ad ee = the camera positio. Ths, we eed to etract these from V ew. Recall from earlier we had V ew = V rot,ew T(-ee ew ) = ee ee ee, ew, ew, ew (eqatio ) = ee ee ee, ew, ew, ew ee ee ee, ew, ew, ew ee, ee, ee ew ew, ew (eqatio 2) Comparig eqatios ad 2, it is eas to see that V rot,ew = Howeer, it is ot so eas to etract ee ew becase the last colm i eqatio 2 is ot ee ew. Howeer, if we kew the ierse of V rot,ew, the we cold obtai T(-ee ew ) = (V - rot,ew V rot,ew ) T(-ee ew ) - = V rot,ew ( V rot,ew T(-ee ew ) ) = V - rot,ew V ew Sice the ierse of a pre rotatio is jst its traspose, we ca easil obtai V rot,ew -, so that we ca calclate T(-ee ew ) = V rot,ew -T V ew.

Oce we hae T(-ee ew ): T(-ee ew ) = ee ee ee, ew, ew, ew we see that ee ew ca be obtaied b pllig ot the last colm of T(-ee ew ), egatig the first three compoets to obtai ee ew = (ee,ew, ee,ew, ee,ew, ).