22
5.2 Three-Dimensional Geometric and Modeling Transformations 2D 3D Consideration for the z coordinate

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

Embed Size (px)

Citation preview

Page 1: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

5.2 Three-Dimensional Geometric and Modeling Transformations

2D

3DConsideration for the z coordinate

Page 2: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration 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

Page 3: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

5.2.2 Rotation Designate an axis of rotation and the

amount of angular rotation

Page 4: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 5: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 6: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 7: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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.

Page 8: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

General Three-Dimensional Rotations

Step 2: Perform the specified rotation about that axis.

Page 9: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

General Three-Dimensional Rotations

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

Page 10: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

General Three-Dimensional Rotations

Page 11: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

rotation axis passes through the coordinate origin.

Page 12: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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.

Page 13: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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.

Page 14: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 15: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

Sx=Sy=Sz=2

Page 16: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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.

Page 17: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 18: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 19: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

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

Page 20: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate

a = b = 1

Page 21: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate
Page 22: 5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate