Sie sind auf Seite 1von 30
3D geometric transformations M.A.K JAILANI ASSISTANT PROFESSOR DEPT. OF COMPUTER APPLICATIONS SASTRA UNIVERSITY
3D geometric transformations M.A.K JAILANI ASSISTANT PROFESSOR DEPT. OF COMPUTER APPLICATIONS SASTRA UNIVERSITY
3D geometric transformations M.A.K JAILANI ASSISTANT PROFESSOR DEPT. OF COMPUTER APPLICATIONS SASTRA UNIVERSITY
3D geometric transformations M.A.K JAILANI ASSISTANT PROFESSOR DEPT. OF COMPUTER APPLICATIONS SASTRA UNIVERSITY

3D geometric transformations

M.A.K JAILANI ASSISTANT PROFESSOR DEPT. OF COMPUTER APPLICATIONS SASTRA UNIVERSITY

TRANSLATION

TRANSLATION In 3D coordinates representation, a point is translated from position P=(x, y, z) to p’=(x’,
TRANSLATION In 3D coordinates representation, a point is translated from position P=(x, y, z) to p’=(x’,
TRANSLATION In 3D coordinates representation, a point is translated from position P=(x, y, z) to p’=(x’,

In 3D coordinates representation, a point is translated from position P=(x, y, z) to p’=(x’, y’, z’) with the matrix operation

representation, a point is translated from position P=(x, y, z) to p’=(x’, y’, z’) with the

Translation (cont )

Translation (cont ) (or) P’ = T.P Equ(1)
Translation (cont ) (or) P’ = T.P Equ(1)
Translation (cont ) (or) P’ = T.P Equ(1)
Translation (cont ) (or) P’ = T.P Equ(1)
Translation (cont ) (or) P’ = T.P Equ(1)

(or)

P’ = T.P

Translation (cont ) (or) P’ = T.P Equ(1)

Equ(1)

Translation (cont )

Translation (cont ) The parameter t x , t y and t z specifying distances for
Translation (cont ) The parameter t x , t y and t z specifying distances for
Translation (cont ) The parameter t x , t y and t z specifying distances for

The parameter t x , t y and t z specifying distances for the coordinate directions x, y, z are assigned any real values.

The matrix representation of the above equ (1)

X’ = x + t x

Y’ = y + t y

z’ = z + t z

An object is translated in three dimensional by transforming each of the defining points of the objects.

Rotation

Rotation Need to specify which axis the rotation is to be performed To specify the amount
Rotation Need to specify which axis the rotation is to be performed To specify the amount
Rotation Need to specify which axis the rotation is to be performed To specify the amount

Need to specify which axis the rotation is to be performed

To specify the amount of an angular rotation.

The Positive rotation directions about the coordinates axes are counterclockwise, when looking toward the origin from a positive coordinate position on each axis as follows

Rotation about z axis:

looking toward the origin from a positive coordinate position on each axis as follows Rotation about

Fig ( a )

Rotation (cont…)

Rotation (cont…) Rotation about X axis: Fig ( b )
Rotation (cont…) Rotation about X axis: Fig ( b )
Rotation (cont…) Rotation about X axis: Fig ( b )

Rotation about X axis:

Rotation (cont…) Rotation about X axis: Fig ( b )

Fig ( b )

Rotation (cont…)

Rotation (cont…) Rotation about Y axis: Fig ( c )
Rotation (cont…) Rotation about Y axis: Fig ( c )
Rotation (cont…) Rotation about Y axis: Fig ( c )

Rotation about Y axis:

Rotation (cont…) Rotation about Y axis: Fig ( c )

Fig ( c )

Coordinate-Axes rotation

Coordinate-Axes rotation 2 dimensional Z axis rotation equ ation are easily extended to 3D x’ =
Coordinate-Axes rotation 2 dimensional Z axis rotation equ ation are easily extended to 3D x’ =
Coordinate-Axes rotation 2 dimensional Z axis rotation equ ation are easily extended to 3D x’ =

2 dimensional Z axis rotation equation are easily extended to 3D x’ = x cos θ – y cos θ

y’ = x sin θ +

y cos θ

3D x’ = x cos θ – y cos θ y’ = x sin θ +

z’ = z Here θ specifies the rotation angle

3D x’ = x cos θ – y cos θ y’ = x sin θ +

Eqs 1

In homogeneous coordinate form, the three dimensional z-axis equation are expressed as follows Which can
In homogeneous coordinate form, the three dimensional z-axis equation are expressed as follows Which can
In homogeneous coordinate form, the three dimensional z-axis equation are expressed as follows Which can

In homogeneous coordinate form, the three dimensional z-axis equation are expressed as follows

Which can write compactly as

p’ = R z (θ ) . p

the three dimensional z-axis equation are expressed as follows Which can write compactly as p’ =

Cyclic permutation of the Cartesian coordinate axes to produce the three sets of coordinates –axis rotation equation

permutation of the Ca rtesian coordinate axes to produce the three sets of coor dinates –axis
permutation of the Ca rtesian coordinate axes to produce the three sets of coor dinates –axis
permutation of the Ca rtesian coordinate axes to produce the three sets of coor dinates –axis
permutation of the Ca rtesian coordinate axes to produce the three sets of coor dinates –axis

Fig (a)

The transformation equation for rotations about the other two coordinates can be obtained with a
The transformation equation for rotations about the other two coordinates can be obtained with a
The transformation equation for rotations about the other two coordinates can be obtained with a

The transformation equation for rotations about the other two coordinates can be obtained with a cyclic permutation of the coordinate parameter x, y, and z in the eqs (1)

That’s, using the following replacement

x

in the eqs (1) That’s, using the fo llowing replacement x y z x As the

y

the eqs (1) That’s, using the fo llowing replacement x y z x As the above

z

the eqs (1) That’s, using the fo llowing replacement x y z x As the above

x

As the above sequence illustrated in fig(a)

Substituting x y z x we get the equations for an x-axis rotation y’ =
Substituting
x
y
z
x
we get the equations for an x-axis rotation
y’ = y cosθ
- z sinθ
z’ = y sinθ +
z cosθ

x’ = x

Which can be written in the homogeneous form Or p’=R x ( θ ).p Equ
Which can be written in the homogeneous form Or p’=R x ( θ ).p Equ
Which can be written in the homogeneous form Or p’=R x ( θ ).p Equ

Which can be written in the homogeneous form

Which can be written in the homogeneous form Or p’=R x ( θ ).p Equ 6
Which can be written in the homogeneous form Or p’=R x ( θ ).p Equ 6

Or

p’=R x (θ).p

be written in the homogeneous form Or p’=R x ( θ ).p Equ 6 Equ 7

Equ 6

Equ 7

Rotation of an object around the x axis is demonstrated in the following fig (b)

form Or p’=R x ( θ ).p Equ 6 Equ 7 Rotation of an object around
Fig (b)
Fig (b)
Fig (b)
Fig (b)
Fig (b)

Fig (b)

Cyclically permutation coordinates in equ (5) give us the transformation equation for y-axis rotation (
Cyclically permutation coordinates in equ (5) give us the transformation equation for y-axis rotation (
Cyclically permutation coordinates in equ (5) give us the transformation equation for y-axis rotation (

Cyclically permutation coordinates in equ (5) give us the transformation equation for y-axis rotation ( y ->z -> x -> y)

z’ = z cosθ x’ = z sinθ +

- x sinθ x cosθ

y) z’ = z cos θ x’ = z sin θ + - x sin θ

Equ 8

y’ = y The matrix representation for y-axis rotation is

Or

+ - x sin θ x cos θ Equ 8 y’ = y The matrix representation

P’ = R y (θ) . P

+ - x sin θ x cos θ Equ 8 y’ = y The matrix representation

Equ 9

An example of y-axis rotation is shown in the following fig ( c ) An
An example of y-axis rotation is shown in the following fig ( c ) An
An example of y-axis rotation is shown in the following fig ( c ) An

An example of y-axis rotation is shown in the following fig ( c )

of y-axis rotation is shown in the following fig ( c ) An inverse rotation matrix

An inverse rotation matrix is formed by replacing the rotation angle θ by -θ.

We can calculate the inverse of any rotation matrix R by evaluating its transpose R 1 = R T

General Three-Dimensional Rotation

General Three-Dimensional Rotation An object is to be rotated about an axis that is parallel to
General Three-Dimensional Rotation An object is to be rotated about an axis that is parallel to
General Three-Dimensional Rotation An object is to be rotated about an axis that is parallel to

An object is to be rotated about an axis that is parallel to one of the coordinate axes

1.Translate the object so that the rotation axis coincides with the parallel coordinate axis

2.Perform the specified rotation about that axis

3.Translate the object so that the rotation axis is moved back to its original position

P

'

=

T

1

R

x

(

θ

)

T

P

Where the composite matrix for the transformation is

R

(

θ

)

=

T

1

R

x

(

θ

)

T

General Three-Dimensional Rotation (cont’d)

General Three-Dimensional Rotation (cont’d)

General Three-Dimensional Rotation (cont’d)
General Three-Dimensional Rotation (cont’d)
General Three-Dimensional Rotation (cont’d)

General Three-Dimensional Rotation (cont’d)

General Three-Dimensional Rotation (cont’d) An object is to be rotated about an axis that is not
General Three-Dimensional Rotation (cont’d) An object is to be rotated about an axis that is not

An object is to be rotated about an axis that is not parallel to one of the coordinate axes

1.Translate the object so that the rotation axis passes through the coordinate origin.

2.Rotate the object so that the axis of rotation coincide with one of the coordinate axes.

3.Perform the specified rotation about that coordinate axis.

4.Apply inverse rotations to bring the rotation axis back to its original orientation.

5.Apply the inverse Translation to bring the rotation axis back to its original position.

General Three-Dimensional Rotation (cont’d)

General Three-Dimensional Rotation (cont’d)
General Three-Dimensional Rotation (cont’d)
General Three-Dimensional Rotation (cont’d)

Scaling

Scaling Scaling with respect to the coordinate origin ⎡ x ' ⎤ ⎡ ⎢ ⎢ ⎢
Scaling Scaling with respect to the coordinate origin ⎡ x ' ⎤ ⎡ ⎢ ⎢ ⎢
Scaling Scaling with respect to the coordinate origin ⎡ x ' ⎤ ⎡ ⎢ ⎢ ⎢

Scaling with respect to the coordinate origin

x ' ⎤ ⎡



y z '

= ⎢

'

1

s

x

0

0

0

0

s

y

0

0

0

0

0

s

z

0

0 ⎤ ⎡ x

y

z

1

0

0


⋅ ⎢

1

⎦ ⎣

P '= S P

Scaling

Scaling Scaling with respect to a selected fixed position (x f , y f , z
Scaling Scaling with respect to a selected fixed position (x f , y f , z
Scaling Scaling with respect to a selected fixed position (x f , y f , z

Scaling with respect to a selected fixed position (x f , y f , z f )

1. Translate the fixed point to origin

2. Scale the object relative to the coordinate origin

3. Translate the fixed point back to its original position

T

(

x

f

,

y

f

,

z

f

)

(

S s

x

,

s

y

,

s

z

)

T

(

x

f

,

y

f

,

z

f

)

=

s

x

0

0

0

0

s

y

0

0

0

0

s

z

0

(1

(1

(1

)

x

)

s

x

f

s y

y

f

s

z

)

z

f

1

Scaling

Scaling
Scaling
Scaling
Scaling

Reflections

Reflections RF = z ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1
Reflections RF = z ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1
Reflections RF = z ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1

RF =

z

1

⎡ 1


0

0

0

0

1

0

0

0

0

0

1

0

0

0

1

Reflections RF = z ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1
Reflections RF = z ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1

Shears

Shears SH z = ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1
Shears SH z = ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1
Shears SH z = ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1

SH z =

1

⎡ 1


0

0


0

0

1

0

0

a

b

1

0

0

0


0

1

Shears SH z = ⎡ 1 ⎢ ⎢ 0 ⎢ 0 ⎢ ⎣ 0 0 1

Composite transformations

Composite transformations Carried out from right to left, where the rightmost matrix is the first transformation
Composite transformations Carried out from right to left, where the rightmost matrix is the first transformation
Composite transformations Carried out from right to left, where the rightmost matrix is the first transformation

Carried out from right to left, where the rightmost matrix is the first transformation to be applied to an object and the leftmost matrix is the last transformation.