5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z...

Post on 27-Dec-2015

219 views 0 download

Transcript of 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z...

5.2 Three-Dimensional Geometric and Modeling Transformations

2D

3DConsideration for the z coordinate

5.2.1 Translation From position P=(x, y, z) to P’ (x’, y’,

z’)

11000

100

010

001

1

'

'

'

z

y

x

t

t

t

z

y

x

z

y

x

Or P’=T· P

An equivalent representation:

x’=x +tx y’=y + ty z’=z + tz

5.2.2 Rotation Designate an axis of rotation and the

amount of angular rotation

Coordinate-Axes Rotations

11000

0100

00cossin

00sincos

1

z

y

x

z

y

x

x' = x cosθ - y sinθ

y' = x sinθ + y cosθ

z' = z

Z-axis rotation equation:

Homogeneous coordinate form

Or P’= Rz(θ)· P

a cyclic permutation of the coordinate parameters x, y

x → y → z → x

x' = x cosθ - y sinθ

y' = x sinθ + y cosθ

z' = z

Z-axis rotation equation:

y' = y cosθ - z sinθ

z' = y sinθ + z cosθ

x' = x

X-axis rotation equation:

11000

0100

00cossin

00sincos

1

z

y

x

z

y

x

11000

0cossin0

0sincos0

0001

1

z

y

x

z

y

x

Or P’= Rz(θ)· P Or P’= Rx(θ)· P

y' = y cosθ - z sinθ

z' = y sinθ + z cosθ

x' = x

X-axis rotation equation:

11000

0cossin0

0sincos0

0001

1

z

y

x

z

y

x

z' = z cosθ – x sinθ

x' = z sinθ + x cosθ

y' = y

Y-axis rotation equation:

11000

0cos0sin

0010

0sin0cos

1

z

y

x

z

y

x

Or P’= Ry(θ)· POr P’= Rx(θ)· P

General Three-Dimensional Rotations

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

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

General Three-Dimensional Rotations

Step 2: Perform the specified rotation about that axis.

General Three-Dimensional Rotations

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

General Three-Dimensional Rotations

rotation about an arbitrary axis (five steps)Step 1: Translate the object so that the

rotation axis passes through the coordinate origin.

rotation about an arbitrary axis (five steps)Step 2:Rotate the object so that the axis of rotation coincides with one of the coordinate axes.Step 3:Perform the specified rotation about that coordinate axis.

rotation about an arbitrary axis (five steps)Step 4: Apply inverse rotations to bring the rotation

axis back to its original orientation.Step 5: Apply the inverse translation to bring the

rotation axis back to its original position.

5.2.3 Scaling From position P=(x, y, z) to P’ (x’, y’,

z’)

11000

000

000

000

1

'

'

'

z

y

x

s

s

s

z

y

x

z

y

x

Or P’=S· P

An equivalent representation:

x' = x' · sx, y' = y · sy, z' = z · sz

Sx=Sy=Sz=2

Scaling with respect to a fixed position (xf, yf, zf,)

Step 1: Translate the fixed point to the origin.Step 2: Scale the object relative to the coordinate origin .Step 3: Translate the fixed point back to its original

position.

5.2.4 Other Transformation ---- reflection

1000

0100

0010

0001

zRF

The matrix representation for this reflection of points relative to the xy plane is

5.2.4 Other Transformation

1000

0100

0010

0001

xRF

The matrix representation for this reflection of points relative to the yz plane is

1000

0100

0010

0001

RFy

The matrix representation for this reflection of points relative to the zx plane is

5.2.4 Other Transformation ---- shear

As an example of three-dimensional shearing, the following transformation produces a z-axis shear:

1000

0100

010

001

b

a

SH z

11000

0100

010

001

1

z

y

x

b

a

z

y

x

a = b = 1