CT4510: Computer Graphics. Transformation BOCHANG MOON

Similar documents
Pre-Kindergarten 2017 Summer Packet. Robert F Woodall Elementary

Math A Regents Exam 0806 Page 1

Jasmin Smajic 1, Christian Hafner 2, Jürg Leuthold 2, March 16, 2015 Introduction to Finite Element Method (FEM) Part 1 (2-D FEM)

Bayesian Methods: Naïve Bayes

Bézier Curves and Splines

Simplifying Radical Expressions and the Distance Formula

ECO 745: Theory of International Economics. Jack Rossbach Fall Lecture 6

Coaches, Parents, Players and Fans

EQ: G.CO.4 How do I reflect over parallel and perpendicular lines?

Lesson 14: Modeling Relationships with a Line

New Albany / Fred Klink Memorial Classic 3rd Grade Championship Bracket **Daylight Saving Time - Turn Clocks Up One Hour**

Attacking and defending neural networks. HU Xiaolin ( 胡晓林 ) Department of Computer Science and Technology Tsinghua University, Beijing, China

Course 495: Advanced Statistical Machine Learning/Pattern Recognition

Tie Breaking Procedure

Abstract In this paper, the author deals with the properties of circumscribed ellipses of convex quadrilaterals, using tools of parallel projective tr

Conservation of Energy. Chapter 7 of Essential University Physics, Richard Wolfson, 3 rd Edition

Functions of Random Variables & Expectation, Mean and Variance

A COURSE OUTLINE (September 2001)

Unit 7. Math Problem 1. This segment will go through the endpoint of the original line segment, perpendicular to the line segment.

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

Minimum Mean-Square Error (MMSE) and Linear MMSE (LMMSE) Estimation

Lecture 5. Optimisation. Regularisation

SNARKs with Preprocessing. Eran Tromer

knn & Naïve Bayes Hongning Wang

ISyE 6414 Regression Analysis

Introduction to topological data analysis

Combining Experimental and Non-Experimental Design in Causal Inference

graphic standards manual Mountain States Health Alliance

What is Restrained and Unrestrained Pipes and what is the Strength Criteria

Special Topics: Data Science

EE582 Physical Design Automation of VLSI Circuits and Systems

Use of Auxiliary Variables and Asymptotically Optimum Estimators in Double Sampling

Communication Amid Uncertainty

Algebra I: A Fresh Approach. By Christy Walters

POST TEST KEY. Math in a Cultural Context*

CS249: ADVANCED DATA MINING

Imperfectly Shared Randomness in Communication

Lesson 23: The Volume of a Right Prism

Lecture 10. Support Vector Machines (cont.)

Communication Amid Uncertainty

SHIP FORM DEFINITION The Shape of a Ship

Dynamic Programming: The Matrix Chain Algorithm

Vectors. Wind is blowing 15 m/s East. What is the magnitude of the wind s velocity? What is the direction?

Physical Design of CMOS Integrated Circuits

Massey Method. Introduction. The Process

CS145: INTRODUCTION TO DATA MINING

PHYSICAL FUNCTION DANCE

Logistic Regression. Hongning Wang

VECTORS Important Questions from CBSE point of view

COMPLEX NUMBERS. Powers of j. Consider the quadratic equation; It has no solutions in the real number system since. j 1 ie. j 2 1

Addition and Subtraction of Rational Expressions

Edexcel GCSE. Mathematics A 1387 Paper 5523/03. November Mark Scheme. Mathematics A 1387

NATIONAL FEDERATION RULES B. National Federation Rules Apply with the following TOP GUN EXCEPTIONS

Lesson 18: There Is Only One Line Passing Through a Given Point with a Given Slope

Write these equations in your notes if they re not already there. You will want them for Exam 1 & the Final.

Report for Experiment #11 Testing Newton s Second Law On the Moon

INSTALLING THE PROWLER 13 RUDDER

115th Vienna International Rowing Regatta & International Masters Meeting. June 15 to June 17, 2018

Rotations: Day 3 Rotations.notebook. September 16, the center point of rotation (origin) 3. angle of rotation (multiples of 90) 0 o

INTERNATIONAL SPORT KITE COMPULSORIES BOOK. Version APRIL-2017

Operational Risk Management: Preventive vs. Corrective Control

Date: Period: Directions: Answer the following questions completely on a separate sheet of paper.

Configurable Test-Goal Set Partitioning for Directed Multi- Goal Test Generation

Midterm Exam 1, section 2. Thursday, September hour, 15 minutes

Physics: Principles and Applications, 6e Giancoli Chapter 3 Kinematics in Two Dimensions; Vectors. Conceptual Questions

#7 Still more DP, Scoring Matrices 9/5/07

Strand E. Waves. Unit 1. Measuring Waves. Text. Types of Wave 2 Measuring Waves 6 Phase 10

Chapter 3 PRESSURE AND FLUID STATICS

Candidate Number. General Certificate of Secondary Education Foundation Tier January 2013

Product Decomposition in Supply Chain Planning

Anemometry. Anemometry. Wind Conventions and Characteristics. Anemometry. Wind Variability. Anemometry. Function of an anemometer:

The Simple Linear Regression Model ECONOMETRICS (ECON 360) BEN VAN KAMMEN, PHD

Stress Strain, Principal Axes, and Mohr's Circle

ISO INTERNATIONAL STANDARD

1. At what speed must you throw a ball vertically in order to reach the top of a building, 12m tall? Vectors

Objectives deals with forces applied by fluids at rest or in rigid-body motion.

Modeling the Relationship Between MLB Ballparks and Home Team Performance. Using Shape Analysis. Sara Biesiadny, B.S. A Thesis

Areas of Parallelograms and Triangles 7-1

Average speed is calculated by taking the total distance travelled and dividing it by the total time:

Name: Grade: LESSON ONE: Home Row

World Eight Ball Pool Federation Rules Unabridged Version Issued January 2009 An abridged version of the latest rules may be downloaded here (pdf)

October 09, Ch04 2Dmotion.notebook. Honors Physics Chapter 4. Scalar Vector Resultant. Components

One-factor ANOVA by example

Relative Motion. A look at "Frames of Reference" Website

8-1. The Pythagorean Theorem and Its Converse. Vocabulary. Review. Vocabulary Builder. Use Your Vocabulary

DNS Study on Three Vortex Identification Methods

Common Core State Standards

Holly Burns. Publisher Mary D. Smith, M.S. Ed. Author

METROLOGY LAB. I DEVICES BASED ON VERNIER SCALE

Introduction to Genetics

My ABC Insect Discovery Book

REAL LIFE GRAPHS M.K. HOME TUITION. Mathematics Revision Guides Level: GCSE Higher Tier

Computer Graphics. Prof. Jaakko Lehtinen. with lots of material from Frédo Durand. Picture: Alexis Rufatt. T Spring 2013 Lehtinen Mar 22

The Diver Returns Circular Functions, Vector Components, and Complex Numbers

Full Name: Period: Heredity EOC Review

Algebra I: A Fresh Approach. By Christy Walters

NEUE DONAU / VIENNA. June 24 to 26,

LLT Education Services

REVIEW : KINEMATICS

3 1 PRESSURE. This is illustrated in Fig. 3 3.

Transcription:

CT4510: Computer Graphics Transformation BOCHANG MOON

2D Translation Transformations such as rotation and scale can be represented using a matrix M ee. gg., MM = SSSS xx = mm 11 xx + mm 12 yy yy = mm 21 xx + mm 22 yy How about translation? xx = xx + xx δδ yy = yy + yy δδ No way to express this using a 2 x 2 matrix

Homogeneous Coordinates Affine transformation Preserve points, straight lines, and planes after a transformation e.g., scale, rotation, translation, reflect, shear Represent the point (x, y) by a 3D vector xx, yy, 1 tt Add an extra dimension Use the following matrix form to implement affine transformations MM = mm 11 mm 12 xx δδ mm 21 mm 22 yy δδ 0 0 1

Homogeneous Coordinates Compactly represent multiple affine transformations (including translations) with a matrix e.g., 2D translation 1 0 xx δδ 0 1 yy δδ 0 0 1 xx yy 1 = xx + xx δδ yy + yy δδ 1 e.g., rotation after 2D translation MM = ccoooooo ssssssss 0 ssssssss cccccccc 0 0 0 1 1 0 xx δδ 0 1 yy δδ 0 0 1

Examples Problem specification: move a 2D rectangle into a new position y (xx h, yy h ) y (xx h, yy h ) (xx ll, yy ll ) (xx ll, yy ll ) x x

Examples Problem specification: move a 2D rectangle into a new position Step1. translate: move the point xx ll, yy ll to the origin y (xx h, yy h ) y (xx ll, yy ll ) (xx h xx ll, yy h yy ll ) x x

Examples Problem specification: move a 2D rectangle into a new position Step2. scale: resize the rectangle to be the same size of the target. y y (xx h xx ll, yy h yy ll ) (xx h xx ll, yy h yy ll ) x x

Examples Problem specification: move a 2D rectangle into a new position Step3. translate: move the origin to point (xx ll, yy ll ) y (xx h xx ll, yy h yy ll ) y (xx h, yy h ) (xx ll, yy ll ) x x

Examples Problem specification: move a 2D rectangle into a new position Target = translate(xx ll, yy ll ) ssssssssss xx h xx ll, yy h yyll xx h xx ll yy h yy ll tttttttttttttttttt( xx ll, yy ll ) = 1 0 xx ll 0 1 yy ll 0 0 1 xx h xxll xx h xx ll 0 0 0 yy h yyll yy h yy ll 0 0 0 1 1 0 xx ll 0 1 yy ll 0 0 1 = xx h xxll 0 xx h xx ll 0 yy h yyll yy h yy ll xx ll xxh xx h xxll xx h xx ll yy ll yyh yy h yyll yy h yy ll 0 0 1

Rigid-body Transformation A transformation that preserves distances between every pair of points Are composed only of translations and rotations i.e., no stretching or shrinking of the objects

Discussion Homogenous coordinates are common for graphics applications. Why? A naïve way of implementing translations is to move the positions directly without forming a matrix

3D Transformation Extension of 2D transformation Why 3D transformation? You virtual world is a 3D world. 3D transformations are fundamental units to form your virtual scene.

OpenGL 3D coordinate Right-hand Coordinate System (RHS) Counter-clockwise y (0,0,0) x z

3D Transformation (scale) ssssssssss ss xx, ss yy, ss zz = ss xx 0 0 0 ss yy 0 0 0 ss zz Representation with homogeneous coordinates ss xx 0 0 0 0 ss yy 0 0 0 0 ss zz 0 0 0 0 1

3D Transformation (translation) tttttttttttttttttt(xx, yy, zz) = 1 0 0 1 0 0 0 0 0 xx 0 yy 1 zz 0 1

3D Transformation (rotation) rrrrrrrrrrrr zz θθ = rrrrrrrrrrrr yy θθ = rrrrrrrrrrrr xx θθ = cccccccc ssssssss 0 ssssssss cccccccc 0 0 0 1 cccccccc 0 ssssssss 0 1 0 ssssssss 0 cccccccc 1 0 0 0 cccccccc ssssssss 0 ssssssss cccccccc Representation with homogeneous coordinates rrrrrrrrrrrr zz θθ = cccccccc ssssssss ssssssss cccccccc 0 0 0 0 0 0 0 0 1 0 0 1

3D Transformation (rotation) 2D, 3D rotations are orthogonal matrices. Rows of the matrix are mutually orthogonal unit vectors Need some background on vectors

Background: Vector A vector describes a length and a direction Commonly drawn by an arrow

Background: Vector A vector describes a length and a direction Notations: a (bold character) Other ways? e.g., aa Length of a vector a Unit vector A vector a if a = 1 Zero vector A vector a if a = 0 Two vectors are equal if and only if they have the same length and direction.

Background: Vector Vector addition: Parallelogram rule a+b b Properties aa + bb = bb + aa (commutative) a a+b b a

Background: Vector Unary minus of a vector a -aa -a a Subtraction bb aa aa + bb Scale k aa b b-a a a 0.5a

Background: Basis Vector A 2D vector can be written as a combination of any two nonzero vectors which are not parallel (linear independence) Two linearly independent vectors (basis vectors) form a 2D basis e.g., cc = aa cc aa + bb cc bb Weights are unique b c 0.5b a 2a

Background: Basis Vector A 2D vector can be written as a combination of any two nonzero vectors which are not parallel (linear independence) Two linearly independent vectors (basis vectors) form a 2D basis Orthogonality Two vectors are orthogonal if they are at right angles to each other b a

Background: Basis Vector A 2D vector can be written as a combination of any two nonzero vectors which are not parallel (linear independence) Two linearly independent vectors (basis vectors) form a 2D basis Special cases Two vectors are orthogonal if they are at right angles to each other Two vectors are orthonormal if they are orthogonal and unit vectors y x y x = y = 1 x Note: the special vectors can be used to represent all other vectors in a Cartesian coordinate system A coordinate system that specifies each point uniquely

Background: Cartesian Coordinate System Special cases Two vectors are orthogonal if they are at right angles to each other Two vectors are orthonormal if they are orthogonal and unit vectors Note: the special orthonormal vector can be used to represent all other vectors in a Cartesian coordinate system A coordinate system that specifies each point uniquely in a plane or 3D space by a pair of numerical components ee. gg., aa = xx aa xx + yy aa yy xx aa and yy aa are Cartesian coordinates of the 2D vector aa Image from wikipedia

Background: Cartesian Coordinate System Properties of a Cartesian coordinate system aa = xx aa 2 + yy aa 2 aa = xx aa yy aa aa TT = [xx aa yy aa ] 3D case aa = xx aa xx + yy aa yy + zz aa zz x, y, z are orthonormal

Background: Dot Product Vector multiplications Dot product (scalar product) aa bb = aa bb cccccccc b Properties aa bb = bb aa (commutative) aa bb + cc = aa bb + aa cc (distributive) kkaa bb = aa kkbb = kkaa bb (scalar multiplication) θθ a Orthogonal aa bb = aa bb cccccccc = 0 Two non-zero vectors a and b are orthogonal if and only if aa bb = 0

Background: Dot Product Vector multiplications Dot product (scalar product) aa bb = aa bb cccccccc a Usage: aa bb projection of a vector to another one aa bb = aa cosθθ = aa bb bb Note: this is the length of the projected vector onto b θθ b Dot product in Cartesian coordinates Properties: xx xx = yy yy = 1 and xx yy = 0 aa bb = (xx aa xx + yy aa yy) xx bb xx + yy bb yy = xx aa xx bb xx xx + xx aa yy bb xx yy + xx bb yy aa yy xx + yy aa yy bb yy yy = xx aa xx bb + yy aa yy bb In 3D, aa bb = xx aa xx bb + yy aa yy bb + zz aa zz bb

Background: Cross Product Vector multiplications Cross products (used only for 3D vectors) aa bb = aa bb ssssssss n n: unit vector that is perpendicular to aa and bb Return a 3D vector that is perpendicular to the two arguments Two possible directions of the resulting vector Length of the resulting vector aa bb = aa bb ssssssss Equal to the area of the parallelogram formed by the two vectors aa and bb a x b θθ b a Three Cartesian unit vectors xx = 1,0,0 yy = 0,1,0 zz = 0,0,1

Background: Cross Product Cross products of the unit vectors xx yy = zz yy xx = zz yy zz = xx zz yy = xx zz xx = yy xx zz = yy z Note: We set a convention that xx yy should be in the plus or minus z direction xx yy yy xx y (0,0,0) OpenGL 3D coordinate x

Background: Cross Product Properties aa bb + cc = aa bb + aa cc aa kkbb = kk(aa bb) aa bb = (bb aa) Cross product in Cartesian coordinates (based on xx xx = 00) aa bb = xx aa xx + yy aa yy + zz aa zz xx bb xx + yy bb yy + zz bb zz = xx aa xx bb xx xx + xx aa yy bb xx yy + xx aa zz bb xx zz + yy aa xx bb yy xx + yy aa yy bb yy yy + yy aa zz bb yy zz + zz aa xx bb zz xx + zz aa yy bb zz yy + zz aa zz bb zz zz = yy aa zz bb zz aa yy bb xx + zz aa xx bb xx aa zz bb yy + xx aa yy bb yy aa xx bb zz In coordinate form, aa bb = (yy aa zz bb zz aa yy bb, zz aa xx bb xx aa zz bb, xx aa yy bb yy aa xx bb )

3D Transformation (rotation) cont d 2D, 3D rotations are orthogonal matrices. Rows of the matrix are mutually orthogonal unit vectors (orthonormal)

3D Transformation (rotation) cont d Inverse of transformation matrices Scale matrix is a diagonal matrix MM = mm 11 0 0 0 0 mm 22 0 0 0 0 0 0 mm 33 0 0 mm 44, MM 1 = 1/mm 11 0 0 0 0 1/mm 22 0 0 0 0 0 0 Rotation matrices are orthonormal matrices A square matrix whose rows are orthogonal unit vectors RR TT RR = RRRR TT = II RR 1 = RR TT 1/mm 33 0 0 1/mm 44