Geometric Objects and Transformations

Similar documents
Lecture 3: Coordinate Systems and Transformations

Vector Spaces; the Space R n

Section 1.1. Introduction to R n

2D Geometric Transformations

Solving Simultaneous Equations and Matrices

2D Geometrical Transformations. Foley & Van Dam, Chapter 5

LINEAR ALGEBRA W W L CHEN

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

CS 4204 Computer Graphics

α = u v. In other words, Orthogonal Projection

Computer Graphics Labs

Linear Algebra Review. Vectors

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix.

Lecture L3 - Vectors, Matrices and Coordinate Transformations

9 MATRICES AND TRANSFORMATIONS

Essential Mathematics for Computer Graphics fast

Geometric Transformation CS 211A

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

Geometric Camera Parameters

Section Continued

Unified Lecture # 4 Vectors

ISOMETRIES OF R n KEITH CONRAD

Rotation Matrices and Homogeneous Transformations

Figure 1.1 Vector A and Vector F

Affine Transformations

Similarity and Diagonalization. Similar Matrices

TWO-DIMENSIONAL TRANSFORMATION

3 Orthogonal Vectors and Matrices

ME 115(b): Solution to Homework #1

Lecture 2: Homogeneous Coordinates, Lines and Conics

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

A vector is a directed line segment used to represent a vector quantity.

MOVIES, GAMBLING, SECRET CODES, JUST MATRIX MAGIC

Systems of Linear Equations

Vectors Math 122 Calculus III D Joyce, Fall 2012

Number Sense and Operations

Inner Product Spaces and Orthogonality

CS3220 Lecture Notes: QR factorization and orthogonal transformations

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Geometric Transformations

Cross product and determinants (Sect. 12.4) Two main ways to introduce the cross product

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Lecture 7. Matthew T. Mason. Mechanics of Manipulation. Lecture 7. Representing Rotation. Kinematic representation: goals, overview

Vector Math Computer Graphics Scott D. Anderson

3. Let A and B be two n n orthogonal matrices. Then prove that AB and BA are both orthogonal matrices. Prove a similar result for unitary matrices.

Linear Algebra Notes for Marsden and Tromba Vector Calculus

by the matrix A results in a vector which is a reflection of the given

Section 1.4. Lines, Planes, and Hyperplanes. The Calculus of Functions of Several Variables

Here are some examples of combining elements and the operations used:

Chapter 6. Orthogonality

B4 Computational Geometry

Orthogonal Projections

521493S Computer Graphics. Exercise 2 & course schedule change

Vector Treasure Hunt Teacher s Guide

Problem Set 5 Due: In class Thursday, Oct. 18 Late papers will be accepted until 1:00 PM Friday.

Name: Section Registered In:

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

( ) which must be a vector

THREE DIMENSIONAL GEOMETRY

Lecture 2 Matrix Operations

Pennsylvania System of School Assessment

Linear Algebra: Vectors

Fundamentals of Computer Animation

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

5. Orthogonal matrices

University of Lille I PC first year list of exercises n 7. Review

2. Spin Chemistry and the Vector Model

Continued Fractions and the Euclidean Algorithm

FOREWORD. Executive Secretary

Matrix Calculations: Applications of Eigenvalues and Eigenvectors; Inner Products

Elasticity Theory Basics

1 VECTOR SPACES AND SUBSPACES

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Towards Online Recognition of Handwritten Mathematics

Numerical Analysis Lecture Notes

3. INNER PRODUCT SPACES

MATH1231 Algebra, 2015 Chapter 7: Linear maps

Geometry for Computer Graphics

1 The Concept of a Mapping

A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form

Vector Algebra II: Scalar and Vector Products

Lecture 5: Singular Value Decomposition SVD (1)

Physics 235 Chapter 1. Chapter 1 Matrices, Vectors, and Vector Calculus

Exam 1 Sample Question SOLUTIONS. y = 2x

Chapter 17. Orthogonal Matrices and Symmetries of Space

MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors. Jordan canonical form (continued).

Math 241 Lines and Planes (Solutions) x = 3 3t. z = 1 t. x = 5 + t. z = 7 + 3t

Continuous Groups, Lie Groups, and Lie Algebras

Linear Algebra Notes

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Linear Algebra I. Ronald van Luijk, 2012

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Introduction to Geometric Algebra Lecture II

Metrics on SO(3) and Inverse Kinematics

Section 9.1 Vectors in Two Dimensions

1 Introduction to Matrices

Kinematics of Robots. Alba Perez Gracia

Transcription:

Geometric Objects and ransformations How to represent basic geometric types, such as points and vectors? How to convert between various represenations? (through a linear transformation!) How to establish a method for dealing with geometric problems independent of coordinate systems? Homogeneous coordinates Affine transformations OpenGL transformation matrices (in discussion session)

Mathematical Spaces Linear Vector Spaces Scalars and vectors Examples of vector spaces: 1. geometric vectors 2. n tuples of real numbers 3. scalar vector multiplication and vector vector addition. he greatest number of linearly independent vectors that we can find in a space gives the dimension of the space Bases Affine Spaces Add points > location point to point subtraction yields a vector vector point multiplication yields a point Frames Euclidean Spaces Add measure of size or distance Inner product

Fundamental geometric objects: point a location in space vector a directed line seqment Coordindate systems (frames): a point can be represented unambiguously with a fixed reference point (the origin) a vector can be uniquely defined as: w = α1 v1 + α2 v2 + α3 v3 a = [ α1 α2 α3 ] w = a v1 v2 v3 then a point in a coordinate system defined by P0 (the origin) and a basis vector (v1, v2, v3) can be written as: P = P0 + u v1 + v v2 + w v3 P0 v2 P v1 v3

Changes of Coordinate Systems Object World View Screen How the representation of a vector changes when we change the basis vectors? v = (v1, v2, v3) < > u = (u1, u2, u3) here exists a relationship between the two bases: u1 = γ11 v1 + γ12 v2 + γ13 v3 u2 = γ21 v1 + γ22 v2 + γ23 v3 u3 = γ31 v1 + γ32 v2 + γ33 v3 u2 v2 u1 Which is captured by a 3x3 matrix: v1 M = γ11 γ12 γ13 γ21 γ22 γ23 γ31 γ32 γ33 v3 u3 transforms a vector in one basis to its representation in the second basis: u = M v and v = M 1 u

Moving from abstract vectors to working with column matrices of scalars Consider a vector w = α1 v1 + α2 v2 + α3 v3 = a v1 v2 where a = v3 α1 α2 α3 while with respect to a different basis u = u1 u2 u3 w = β1 u1 + β2 u2 + β3 u3 = b u the 2nd basis in terms of the 1st: w = b u = b M v = a v Hence a = M b and b = (M ) a Remember the underlying basis!! 1

Rotation and scaling of a basis: v2 v2 v1 v1 v3 v3 Leave the origin unchanged!! ranslation of a basis cannot be represented with the 3x3 matrix: v2 v3 v1 Can we "expand" the representation such that we can change frames yet still to use matrices to represent the change?

Homogeneous Coordinates Usually we represent a point located at (x, y, z) using a frame determined by P0, v1, v2, v3 as P = x y z for a vector w = δ1v1 + δ2v2 + δ2v3 w = δ1 δ2 δ3 How to distinguish between points and vectors? How can we continue using matrix multiplication in 3 dimensions to represent a change in frames? Homogeneous Coordinates!! Use 4 d column matrices to represent both points and vectors in 3 dimensions.

Homogeneous Coordinate Representation v1 P = [ α1 α2 α3 1 ] v2 v3 P0 = α1v1 + α2v2 + α2v3 + P0 w = [ δ1 δ2 δ3 0 ] v1 v2 v3 P0 = δ1v1 + δ2v2 + δ2v3 α1 δ1 P = α2 α3 w = δ2 δ3 1 0 1. Operating using ordinary matrix algebra 2. All affine transformation can be represented as matrix multiplication 3. Concatenation of successive transformations resulting in more efficient calculations 4. Hardware implemented

So for any two frames defined by (v1, v2, v3, P0) and (u1, u2,u3, Q0) A matrix representation of the change of frames: u1 u2 u3 Q0 = M v1 v2 v3 P0 where M = γ11 γ12 γ13 0 γ21 γ22 γ23 0 γ31 γ32 γ33 0 γ41 γ42 γ43 1 for any two points or two vectors a and b in the two frames in homogeneous coordinate representation: u1 b = b M v2 =a u2 v1 u3 v3 Q0 P0 v1 v2 v3 P0 Hence a = M b

Affine ransformation u v A transformation is a function: Q = (P) R v = R (u) P Q using homogeneous coordinates, we can define transformation with a single function: q = f(p) v = f(u) Make f() a linear function: such that f(αp + βq) = αf(p) + βf(q) f is an affine transformation: 1. a combination of linear transformations 2. transform only end points of a line to determine completely a transformed line 3. parallel lines are transformed into parallel lines

A line in point vector form: p(α) = p0 + αv For any affine transformation matrix A: Ap(α) = Ap0 + αad A line in two point form: P(α) = α p0 + (1 α)p1 For any affine transformation matrix A: AP(α) = α Ap0 + (1 α)ap1 Affine ransformations preserve parallelism of lines Rotation, translation, reflection Scaling Shearing

ranslation Displace points by a fixed distance in a given direction P = P + d Rotation: x = ρ cosφ y = ρ sinφ x = ρ cos(θ + φ) y = ρ sin(θ + φ) x = ρ cosφ cosφ ρsinφ sinθ = x cosθ y sinθ y = ρ cosφ sinφ + ρsinφ cosθ = x sinθ + y cosθ ρ θ d φ,, (x, y ) (x,y) x y = cosθ sinθ sinθ cosθ x y

Rotation (cont d) y φ positive o x A fixed point, an angle, and a line or a vector about which to rotate z Scaling With a fixed point, a vector, and a scaling factor p = S p

ransformations in Homegeneous Coordinates Each affine transformation is represented as a 4x4 matrix M = α11 α12 α13 α14 α21 α22 α23 α24 α31 α32 α33 α34 A point is a column matrix P = x y z 0

ranslation = 1 0 0 αx 0 1 0 αy 0 0 1 αz p = p x = x + αx y = y + αy z = z + αz Inverse? 1 = 1 0 0 αx 0 1 0 αy 0 0 1 αz

Scaling S = βx 0 0 0 0 βy 0 0 0 0 βz 0 p = S p x = βx X y = βy y z = βz z Inverse? 1 S = 1/βx 0 0 0 0 1/βy 0 0 0 0 1/βz 0 What happens if βx=βy=βz= 1?

Rotation about a main coordinate axis: Rx(θ) = 1 0 0 0 0 cosθ sinθ 0 0 sinθ cosθ 0 Ry(θ) = cosθ 0 sinθ 0 0 1 0 0 sinθ 0 cosθ 0 Rz(θ) = cosθ sinθ 0 0 sinθ cosθ 0 0 0 0 0 0 p = Rz p x = x cosθ y sinθ y = x sinθ + y cosθ z = z; Inverse? 1 R (θ) = R( θ) = R (θ)

Concatenation of ransformations Concatenate sequences of basic transformations to define an arbitrary transformation directly Matrix product is associative q = CBAp q = C(B(Ap)) For transforming many points M = CBA q = M p

Rotation About a Fixed Point y θ x z Pf M = (pf) Rz(θ) ( pf) In general M = (pf) R(θ) ( pf)

General rotation is easy if θx, θy, θz are known! Rotation About an Arbitrary Axis o specify a rotation, we need: 1. a fixed point P0, center of rotation 2. a vector about which we rotate 3. an angle of rotation θ P2 P1 P0 M = (p0) R(θ) ( p0) What is R(θ)? Align the axis of rotation with one of the main coordinate axis!!

θ P2 y αy P1 P0 z αz 1 v αx x u = p2 p1 v = u / u y 2 2 2 αx + αy + αz = 1 y θx z x z θy x R(θ) = Rx( θx)ry( θy)rz(θ)ry(θy)rx(θx) M = (p0) Rx( θx)ry( θy)rz(θ)ry(θy)rx(θx)( p0)

Rx(θx) = 1 0 0 0 0 cosθ sinθ 0 0 sinθ cosθ 0 Ry(θy) = y cosθ 0 sinθ 0 0 1 0 0 sinθ 0 cosθ 0 z αy d αz 1 v αx x d = 2 2 αy + αz Rx(θx) = 1 0 0 0 0 αz/d αy/d 0 0 αy/d αz/d 0 Ry(θy) = d 0 αx 0 0 1 0 0 αx 0 d 0