0 views

Uploaded by Novianti Marthen

- Copy Pasta
- Sensitivity analysis and modiﬁcation of structural dynamic characteristics using second order approximation
- 9781849691727-Chapter-04_Camera_Sample_Chapter
- Cell Formation
- IGCSEFM-MatrixTransformations-Exercises.docx
- Linear Algebra Spring 2015
- Ada 181538
- Vissim Training - 12. Dynamic Routes
- Automatic Control and Robotics Syllabi
- (2001) a.I.a. Salama_Flowsheet Mass Balance With Partial Observation of Stream Components
- BA201 Engineering Mathematic UNIT6 - Matrices Introduction
- Quaternion report
- Introduction to Visual Computing Core Concepts in Computer Vision, Graphics, and Image Processing.pdf
- 2D geometric transformations
- Metodo de Foss K.A.
- A6-R3 syllabus
- GAD
- AP3114 Lecture WK3 Programming
- 2nd Trial Exam 2009
- Sliding mode control

You are on page 1of 19

Topics:

1.

2.

3.

4.

5.

Change of frames

Affine transformations

Rotation, translation, scaling, and shear

Rotation about an arbitrary axis

Recall that a vector v lR3 can be represented as a linear combination of

three linearly independent basis vectors v1 , v2 , v3 ,

v = 1 v1 + 2 v2 + 3 v3 .

The scalars 1 , 2 , 3 are the coordinates of v. We typically choose

v1 = (1, 0, 0), v2 = (0, 1, 0), v3 = (0, 0, 1) .

v2

v = 1v 1 + 2v 2 + 3v 3

v3

v1

u3 . We express the new basis vectors as combinations of the old ones,

u1 = a11 v1 + a12 v2 + a13 v3 ,

u2 = a21 v1 + a22 v2 + a23 v3 ,

u3 = a31 v1 + a32 v2 + a33 v3 ,

and thus obtain a 3 3 change of basis matrix

a11

M = a21

a31

a12

a22

a32

a13

a23 .

a33

v1

v = a T v2 ,

v3

where a = ( 1

u1

and v = bT u2 ,

u3

3 ) and b = ( 1

3 ) , then

v1

u1

v1

T

T

T

a

v2 = v = b u2 = b M v2 ,

v3

u3

v3

which implies that

a = M T b and b = (M T )1 a.

This 3D coordinate system is not, however, rich enough for use in computer

graphics. Though the matrix M could be used to rotate and scale vectors,

it cannot deal with points, and we want to be able to translate points

(and objects).

In fact an arbitary affine transformation can be achieved by multiplication

by a 3 3 matrix and shift by a vector. However, in computer graphics we

prefer to use frames to achieve the same thing.

A frame is a richer coordinate system in which we have a reference point

P0 in addition to three linearly independent basis vectors v 1 , v2 , v3 , and we

represent vectors v and points P , differently, as

v=

1 v1 + 2 v2 + 3 v3 ,

P = P 0 + 1 v1 + 2 v2 + 3 v3 .

We can use vector and matrix notation and re-express the vector v and

point P as

v = ( 1

v1

v

0) 2 ,

v3

P0

and P = ( 1

v1

v

1) 2 .

v3

P0

Change of frames

Suppose we want to change from the frame (v1 , v2 , v3 , P0 ) to a new frame

(u1 , u2 , u3 , Q0 ). We express the new basis vectors and reference point in

terms of the old ones,

u1 = a11 v1 + a12 v2 + a13 v3 ,

u2 = a21 v1 + a22 v2 + a23 v3 ,

u3 = a31 v1 + a32 v2 + a33 v3 ,

Q0 = a41 v1 + a42 v2 + a43 v3 + P0 ,

and thus obtain a 4 4 matrix

a11

a

M = 21

a31

a41

a12

a22

a32

a42

a13

a23

a33

a43

0

0

.

0

1

homogeneous representations of the same point or vector with respect to

the two frames. Then

v1

u1

v1

v

u

v

aT 2 = b T 2 = b T M 2 ,

v3

u3

v3

P0

Q0

P0

which implies that

a = M T b and b = (M T )1 a.

Affine transformations

The transposed matrix

MT

a11

a

= 12

a13

0

a21

a22

a23

0

a31

a32

a33

0

a41

a42

,

a43

1

of freedom. These degrees of freedom can be viewed as the nine elements

of a 3 3 matrix plus the three components of a vector shift.

The most important affine transformations are rotations, scalings,

and translations, and in fact all affine transformations can be expressed

as combinaitons of these three.

Affine transformations preserve line segments. If a line segment

P () = (1 )P0 + P1

is expressed in homogeneous coordinates as

p() = (1 )p0 + p1 ,

with respect to some frame, then an affine transformation matrix M sends

the line segment P into the new one,

M p() = (1 )M p0 + M p1 .

Similarly, affine transformations map triangles to triangles and tetrahedra

to tetrahedra. Thus many objects in OpenGL can be transformed by transforming their vertices only.

6

Translation is an operation that displaces points by a fixed distance in a

given direction. If the displacement vector is d then the point P will be

moved to

P 0 = P + d.

We can write this equation in homeogeneous coordinates as

p0 = p + d,

where

x

y

p = ,

z

1

x0

y0

0

p = 0 ,

z

1

x

d = y .

z

0

so that

x0 = x + x ,

y 0 = y + y ,

z 0 = z + z .

1

0

T = T (x , y , z ) =

0

0

0

1

0

0

0 x

0 y

,

1 z

0 1

called the translation matrix. One can check that the inverse is

T 1 (x , y , z ) = T (x , y , z ).

Consider first rotation in the plane, about the origin. If a point (x, y) with

coordinates

x = cos ,

y = sin ,

is rotated through an angle , then the new position is (x 0 , y 0 ), where

x0 = cos( + ),

y 0 = sin( + ).

x0 = x cos y sin ,

y 0 = x sin + y cos ,

or

x0

y0

cos

sin

sin

cos

x

.

y

and y axes in lR3 are:

cos

sin

Rz = Rz () =

0

0

sin

cos

0

0

1

0

0 cos

Rx = Rx () =

0 sin

0

0

cos

0

Ry = Ry () =

sin

0

0

0

1

0

0

0

,

0

1

0

sin

cos

0

0

0

,

0

1

0

0

.

0

1

0 sin

1

0

0 cos

0

0

All three give positive rotations for positive with respect to the right

hand rule for the axes x, y, z. If R = R() denotes any of these matrices,

its inverse is clearly

R1 () = R() = RT ().

Translations and rotations are examples of solid-body transformations: transformations which do not alter the size or shape of an object.

a point (x, y, z) to the new point

x0 = x x,

y 0 = y y,

z 0 = z z,

x

0

S = S(x , y , z ) =

0

0

0

y

0

0

0

0

z

0

0

0

,

0

1

with inverse

S 1 (x , y , z ) = S(1/x , 1/y , 1/z ).

If the scaling factors x , y , z are equal then the scaling is uniform:

objects retain their shape but alter their size. Otherwise the scaling is

non-uniform and the object is deformed.

10

are sometimes of independent interest.

y

x0 = x + (cot )y,

y 0 = y,

z 0 = z,

1 cot

1

0

Hx () =

0

0

0

0

0

0

1

0

with inverse

Hx1 () = Hx ().

11

0

0

,

0

1

How do we find the matrix which rotates an object about an arbitrary point

p0 and around a direction u = p2 p1 , through an angle ?

p2

u

p1

p0

z

The answer is to concatenate some of the matrices we have already

developed. We will assume that u has length 1. The first step is to use

translation to reduce the problem to that of rotation about the origin:

M = T (p0 ) R T (p0 ).

To find the rotation matrix R for rotation around the vector u, we first

align u with the z axis using two rotations x and y . Then we can apply

a rotation of around the z-axis and afterwards undo the alignments, thus

R = Rx (x )Ry (y )Rz ()Ry (y )Rx (x ).

12

Rx (x ) will rotate the vector u around the x axis until it lies in the y = 0

plane. Using simple trigonometry, we find that

cos x = z /d,

where d =

sin x = y /d,

1

0

0

0 z /d y /d

Rx (x ) =

0 y /d z /d

0

0

0

0

0

.

0

1

cos y = d,

and so

sin y = x ,

d

0

Ry (y ) =

x

0

13

0 x

1 0

0 d

0 0

0

0

.

0

1

Example in OpenGL

The following OpenGL sequence sets the model-view matrix to represent a

45-degree rotation about the line through the origin and the point (1, 2, 3)

with a fixed point of (4, 5, 6):

void myinit(void)

{

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

glTranslatef(4.0, 5.0, 6.0);

glRotatef(45.0, 1.0, 2.0, 3.0);

glTranslatef(-4.0, -5.0, -6.0);

}

OpenGL concatenates the three matrices into the single matrix

C = T (4, 5, 6) R(45, 1, 2, 3) T (4, 5, 6).

Each vertex p specified after this code will be multiplied by C to yield q,

q = Cp.

14

The following program rotates a cube, using the three buttons of the mouse.

There are three callbacks:

glutDisplayFunc(display);

glutIdleFunc(spincube);

glutMouseFunc(mouse);

The display callback sets the model-view matrix with three angles determined by the mouse callback, and then draws the cube (see Section 4.4 of

the book).

void display()

{

glClear(GL_COLOR_BUFFER_BIT

glLoadIdentity();

glRotatef(theta[0], 1.0, 0.0,

glRotatef(theta[1], 0.0, 1.0,

glRotatef(theta[2], 0.0, 0.0,

colorcube();

glutSwapBuffers();

}

15

GL_DEPTH_BUFFER_BIT);

0.0);

0.0);

1.0);

{

if(btn == GLUT_LEFT_BUTTON && state == GLUT_DOWN) axis = 0;

if(btn == GLUT_MIDDLE_BUTTON && state == GLUT_DOWN) axis = 1;

if(btn == GLUT_RIGHT_BUTTON && state == GLUT_DOWN) axis = 2;

}

The idle callback increments the angle of the chosen axis by 2 degrees.

void spincube()

{

theta[axis] += 2.0;

if(theta[axis] >= 360.0) theta[axis] -= 360.0;

glutPostRedisplay();

}

16

Quarternions offer an alternative way of describing rotations, and have been

used in hardware implementations.

In the complex plane, rotation through an angle can be expressed as

multiplication by the complex number

ei = cos + i sin .

This rotates a given point rei in the complex plane to the new point

rei ei = rei(+) .

Analogously, quarternions can be used to elegantly describe rotations in

three dimensions. A quarternion consists of a scalar and a vector,

a = (q0 , q1 , q2 , q3 ) = (q0 , q).

We can write the vector part q as

q = q1 i + q2 j + q3 k,

where i, j, k play a similar role to that of the unit vectors in lR 3 , and obey

the properties

i2 = j2 = k2 = 1,

and

ij = k = ji,

jk = i = kj,

17

ki = j = ik.

These properties imply that the sum and multiple of two quarternions a =

(q0 , q) and b = (p0 , p) are

a + b = (q0 + p0 , q + p),

and

ab = (q0 p0 q p, q0 p + p0 q + q p).

The magnitude and inverse of a are

q

|a| = q02 + q q,

a1 =

1

(q0 , q).

|a|

arbitrary point. Denote by p0 the rotation of p about the axis v, placed at

the origin. To find p0 using quarternions, we let r be the quarterion

r = (cos(/2), sin(/2)v),

of unit length, whose inverse is clearly

r1 = (cos(/2), sin(/2)v).

Then if p and p0 are the quarternions

p0 = (0, p0 ),

p = (0, p),

we claim that

p0 = r1 pr.

18

Lets check that this is correct! Following the rule for multiplication, a little

computation shows that p0 does indeed have the form (0, p0 ), and that

2

2

2

2

2

But using the identity

p = (v p)v v (v p),

(1)

and the multiple-angle formulas for cos and sin, this simplifies to

p0 = (v p)v + cos (v p) v + sin (v p).

This formula can easily be verified from a geometric interpretation. It is

a linear combination of three orthogonal vectors. The first term (v p)v

is the projection of p onto the axis of rotation, and the second and third

terms describe a rotation in the plane perpendicular to v.

Notice also that the formula clearly represents an affine transformation;

all terms are linear in p. The formula can be used to find the coefficients

of the corresponding transformation matrix directly.

19

- Copy PastaUploaded byStefan
- Sensitivity analysis and modiﬁcation of structural dynamic characteristics using second order approximationUploaded bysumatrablackcoffee453
- 9781849691727-Chapter-04_Camera_Sample_ChapterUploaded byjagdevs7234
- Cell FormationUploaded byAmrik Singh
- IGCSEFM-MatrixTransformations-Exercises.docxUploaded byxiaokia
- Linear Algebra Spring 2015Uploaded bysofi
- Ada 181538Uploaded byspbhavna
- Vissim Training - 12. Dynamic RoutesUploaded byBayu Kusumo Nugroho
- Automatic Control and Robotics SyllabiUploaded bytetraprimig
- (2001) a.I.a. Salama_Flowsheet Mass Balance With Partial Observation of Stream ComponentsUploaded byLuis La Torre
- BA201 Engineering Mathematic UNIT6 - Matrices IntroductionUploaded byAh Tiang
- Quaternion reportUploaded byverthex20992828
- Introduction to Visual Computing Core Concepts in Computer Vision, Graphics, and Image Processing.pdfUploaded byLeonardo Invernizzi
- 2D geometric transformationsUploaded byusama tariq
- Metodo de Foss K.A.Uploaded byNoe David Lazos
- A6-R3 syllabusUploaded byapi-3782519
- GADUploaded bybob
- AP3114 Lecture WK3 ProgrammingUploaded byGuoXuanChan
- 2nd Trial Exam 2009Uploaded byLaw Engtuan
- Sliding mode controlUploaded byerdsan
- Value-Based-Qs.pdfUploaded byBipin Saraswat
- 0 Essentials PlotsUploaded byjworder
- Alternative Input Output Matrix Updating Formulations_Jackson_and_MurrayUploaded byMario Carrasco
- Handout 2Uploaded byKrishna Kulkarni
- Prob Set 7 SolnUploaded byAlplex Katon
- Texto de algebra lineal u de harvard.pdfUploaded byJohn J Gomes Esquivel
- 10266A-Labs.pdfUploaded bypablo_baquero_7
- Three Meanings of Intergenerational Mobility. a FollowUploaded byGabriela Yañez
- LinearUploaded byHrishikesh Phadke
- Roi Baer and Martin Head-Gordon- Energy renormalization-group method for electronic structure of large systemsUploaded byNedsy8

- isprs-archives-XLII-2-W6-101-2017Uploaded byNovianti Marthen
- Shragai - 2011Uploaded byNovianti Marthen
- Szeliski 2002Uploaded byNovianti Marthen
- isprs-archives-XLII-2-W6-93-2017Uploaded byNovianti Marthen
- 23562-55696-1-PBUploaded byNovianti Marthen
- Jun Jiang 2012Uploaded byNovianti Marthen
- Zhong-124Uploaded byNovianti Marthen
- UU No. 4/2011 Tentang Informasi GeospasialUploaded byBayu Kurniawan R
- Zhong-124.pdfUploaded byNovianti Marthen
- Zhong-124.pdfUploaded byNovianti Marthen
- PP 47 - 2011 - Kemenperin_Jenis Dan Tarif PNBPUploaded byaxgani
- isprs-archives-XLII-2-W6-27-2017Uploaded byNovianti Marthen
- Eckerman - 1974Uploaded byNovianti Marthen
- SurfUploaded byThalialvarez
- ijcv04Uploaded bycockdacrjjkl
- Fundamentals of ResearchUploaded byCitizen Kwadwo Ansong
- 06_smoothing.pdfUploaded byNovianti Marthen
- What is ResearchUploaded byNovianti Marthen
- UU_NO_23_2014Uploaded byelmiracell
- isprs-archives-XLII-2-W6-101-2017Uploaded byNovianti Marthen
- frequency analysis - fft.pdfUploaded byvenkatb7
- isprsannals-II-8-151-2014Uploaded byNovianti Marthen
- 2MIH02212Uploaded byNovianti Marthen
- Perka Ketelitian Peta Dasar - SalinanUploaded bylidya
- PP PemetaanUploaded byAdong Tarigan
- Environmental Modelling_Finding Simplicity in Complexity.pdfUploaded byNovianti Marthen
- Environmental Modelling_Finding Simplicity in Complexity.pdfUploaded byNovianti Marthen
- UU No. 18 Th 2002 DanPenjelasannyaUploaded byKang Aryo
- fotogrametriUploaded byDevii Agustiani Sandri
- 05_ScientificMethod_and_Critical_Thinking.pdfUploaded byNovianti Marthen

- lecture notesUploaded byapi-318836863
- 9 Gauss EliminationUploaded bykennethmsoriano
- Matrix ProgrammingUploaded byŠjor Polović
- Subspace MethodsUploaded byDhimas Arief Dharmawan
- AE BTech Syllabus 2011Uploaded byanimeshkumarverma
- Jordan Canonical Form Applications [Steven H. Weintraub]Uploaded byAlejandro Contreras Munive
- Week 5Uploaded bymike099
- PHY10 ReviewerUploaded byAngelo Montelibano Patron
- PYL100_Lec1Uploaded byShabeel HamNaf
- CE201 Statics Chap2Uploaded bytania
- Mutual CouplingUploaded byAsim Saleem
- LongitudinalDynamics.pdfUploaded byDeepak Gaur
- Matrices Dr.s.s.chauhan (1)Uploaded byQadir
- Image Reconstruction with Tikhonov RegularizationUploaded byRichardBehiel
- Babuska Brezzi TheoryUploaded byShelby Gibson
- ManualEJMLUploaded byAlex Cornejo
- Control of Zero-Energy-Modes in 9-Node Plane ElementUploaded byLiu_Dasu
- Maths Guidelines for Board Exams.pdfUploaded byheena
- a-programmers-introduction-to-mathematics.pdfUploaded byparanoia2
- Decision Making by AHP and ANPUploaded byRahmat M Jayaatmadja
- la09.pdfUploaded byNATUREISNATURE
- Assignment 2Uploaded byDevashish Soni
- Higher Maths BookUploaded byNikunj Mundhra
- Vector Calculus - GATE Study Material in PDFUploaded byTestbook Blog
- m.tech. Electrical Power Systems Full-time-finalUploaded bytatyarao
- face recognitionUploaded bykeethu8
- Exam Practice math 2107Uploaded bywylena
- Mechanics of Composite MaterialsUploaded byminhnguyenvonhat
- KG-L2Uploaded byJulian David Henao Escobar
- polynomiaux_lpvUploaded byBessem Bhiri