3D Geometric Transformation (Chapt. 5 in FVD, Chapt. 11 in Hearn - - PDF document

3d geometric transformation
SMART_READER_LITE
LIVE PREVIEW

3D Geometric Transformation (Chapt. 5 in FVD, Chapt. 11 in Hearn - - PDF document

3D Geometric Transformation (Chapt. 5 in FVD, Chapt. 11 in Hearn & Baker) 3D Coordinate Systems Right-handed coordinate system: z y x Left-handed coordinate system: y z x Reminder: Vector Product UxV V U VxU =


slide-1
SLIDE 1

3D Geometric Transformation

(Chapt. 5 in FVD, Chapt. 11 in Hearn & Baker)

3D Coordinate Systems

  • Right-handed coordinate system:
  • Left-handed coordinate system:

y z x x y z

slide-2
SLIDE 2

Reminder: Vector Product

U V UxV VxU

θ sin ˆ V U n V U = ×

θ

          − − − = = ×

x y y x z x x z y z z y z y x z y x

v u v u v u v u v u v u v v v u u u z y x V U ˆ ˆ ˆ

3D Point

  • A 3D point P is represented in

homogeneous coordinates by a 4-dim. vector:

  • Note, that

            = 1 z y x P             ≡             = α α α α z y x z y x p 1

slide-3
SLIDE 3

3D Transformations

  • In homogeneous coordinates, 3D

transformations are represented by 4x4 matrices:

  • A point transformation is

performed:

            1

z y x

t i h g t f e d t c b a

                        =             1 1 1 ' ' ' z y x t i h g t f e d t c b a z y x

z y x

3D Translation

  • P in translated to P' by:
  • Inverse translation:

            + + + =             =                         1 1 ' ' ' 1 1 1 1 1

z y x z y x

t z t y t x z y x z y x t t t

' P P T =

Or

y z x

P P T =

'

1

slide-4
SLIDE 4

Scaling

            =             =                         1 1 ' ' ' 1 1 cz by ax z y x z y x c b a

' P P S =

Or

y z x

P P S =

'

1 y z x

3D Shearing

  • Shearing:
  • The change in each coordinate

is a linear combination of all three.

  • Transforms a cube into a

general parallelepiped.

            + + + + + + =                         1 1 1 1 1 1 z fy ex dz y cx bz ay x z y x f e d c b a

slide-5
SLIDE 5

3D Rotation

  • To generate a rotation in 3D we

have to specify:

– axis of rotation (2 d.o.f) – amount of rotation (1 d.o.f)

  • Note, the axis passes through the
  • rigin.

x y z

  • A counter-clockwise rotation

about the z-axis:

                        − =             1 1 1 cos sin sin cos 1 ' ' ' z y x z y x θ θ θ θ

y z x

p R p

z

) ( ' θ =

slide-6
SLIDE 6
  • A counter-clockwise rotation

about the x-axis:

                        − =             1 1 cos sin sin cos 1 1 ' ' ' z y x z y x θ θ θ θ

y z x

p R p

x

) ( ' θ =

  • A counter-clockwise rotation

about the y-axis:

                        − =             1 1 cos sin 1 sin cos 1 ' ' ' z y x z y x θ θ θ θ

y z x

p R p

y

) ( ' θ =

slide-7
SLIDE 7

Inverse Rotation

' ) ( ' ) (

1

p R p R p θ θ − = =

Composite Rotations

  • Rx, Ry, and Rz, can perform any

rotation about an axis passing through the origin.

Rotation About an Arbitrary Axis

  • Axis of rotation can be located at

any point: 6 d.o.f.

  • The idea: make the axis

coincident with one of the coordinate axes (z axis), rotate, and then transform back.

  • Assume that the axis passes

through the point p0.

y z x

p0

slide-8
SLIDE 8
  • Transformations:

– Translate P0 to the origin. – Make the axis coincident with the z-axis (for example):

  • Rotate about the x-axis into the

xz plane.

  • Rotate about the y-axis onto

the z-axis.

  • Rotate as needed about the z-

axis.

  • Apply inverse rotations about y

and x.

  • Apply inverse translation.

y z x

p0

y x

p0

y x

p0

y x

p0

z z z y x

p0

z y z x

p0

A B C D E F

slide-9
SLIDE 9

3D Reflection

  • A reflection through the xy plane:
  • Reflections through the xz and the

yz planes are defined similarly.

  • How can we reflect through some

arbitrary plane?

            − =                         − 1 1 1 1 1 z y x z y x

Transforming Planes

  • Plane representation:

– By three non-collinear points – By implicit equation:

[ ]

1 =             = + + + z y x D C B A D Cz By Ax

P0 P1 P2

[ ]

1 z y x       1 D C D B D A

slide-10
SLIDE 10
  • One way to transform a plane is

by transforming any three non- collinear points on the plane.

  • Another way is to transform the

plane equation: Given a transformation T that transforms [x,y,z,1] to [x',y',z',1] find [A',B',C',D'], such that:

[ ]

1 ' ' ' ' ' ' ' =             z y x D C B A

  • Note that
  • Thus, the transformation that

we should apply to the plane equation is:

[ ]

1

1

=            

z y x T T D C B A

( )

            =            

D C B A T D C B A

T 1

' ' ' '

slide-11
SLIDE 11

Changing Coordinate Systems

  • Problem: Given the XYZ
  • rthogonal coordinate system,

find a transformation, M, that maps XYZ to an arbitrary

  • rthogonal system UVW.
  • This transformation changes a

representation from the UVW system to the XYZ system.

y z x u=(ux,uy,uz) v=(vx,vy,vz) w=(wx,wy,wz)

(x0,y0,z0)

  • Solution: M=RT where T is a

translation matrix by (x0,y0,z0), and R is rotation matrix whose columns are U,V, and W: because             = 1

z z z y y y x x x

w v u w v u w v u R U u u u w v u w v u w v u RX

z y x z z z y y y x x x

=             =                         = 1 1 1 1

slide-12
SLIDE 12
  • Similarly, Y goes into V, and Z

goes into W.

  • The inverse transform, T-1R-1,

provides the mapping from UVW back to XYZ. For the rotation matrix R-1=RT:

X u u u u u u w w w v v v u u u U R

z y x z y x z y x z y x z y x T

=             =               + + =                         = 1 1 1 1 1

2 2 2

  • Comment: Very useful if an

arbitrary plane is to be mapped to the XY plane or vice versa.

  • Possible to apply if an arbitrary

vector is to be mapped to an axis (How?).

slide-13
SLIDE 13

Transformation Pipe-Line

Viewing Transformation Modeling Transformation Workstation Transformation

Modeling Coordinates

World Coordinates Viewing Coordinates

Device Coordinates

Projection Transformation

Projection Coordinates

Modeling Coordinate Hierarchy

yw zw xw

world Tractor System Front-Wheel System

World Tractor Front-wheel

transformation transformation