0% found this document useful (0 votes)
10 views31 pages

3D Transformation

Uploaded by

aya.almallah.96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views31 pages

3D Transformation

Uploaded by

aya.almallah.96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

3D Geometric

Transformation

cgvr.korea.ac.kr
Contents

■ Translation
■ Scaling
■ Rotation
■ Other Transformations
■ Coordinate Transformations

cgvr.korea.ac.kr
Basic Transformations of the Space
■ Convention:
■ The 3D coordinate system used is right-handed:
■ Positive rotation def.:
□ when looking from a positive axis toward the origin,
□ a 90o counterclockwise rotation
□ will transform one positive axis into the other.
z Z
If axis rotation is Direction of positive
rotation
X Y to z
y Y
Y Z to x

x z X X to y
right-handed coordinate system Left-handed coordinate system
Homogeneous coordinates in 3D

■ In order to model all transformations as matrices:


■ introduce a fourth coordinate, w
■ two vectors are equal if:
□ x/w = x’/w’, y/w = y’/w’ and z/w=z’/w’

■ All transformations are 4x4 matrices


Transformation in 3D

■ Transformation Matrix

3×3 : Scaling, Reflection, Shearing,


Rotation
3×1 :
Translation
1×1 : Uniform global
Scaling
1×3 : Homogeneous
representation
cgvr.korea.ac.kr
3D Translation

■ Translation of a Point

x
z

cgvr.korea.ac.kr
3D Scaling

■ Uniform Scaling

x
z

cgvr.korea.ac.kr
Relative Scaling

■ Scaling with a Selected Fixed Position

y y y y

z x z x z x z x

Original position Translate Scaling Inverse Translate

cgvr.korea.ac.kr
3D Rotation

■ Coordinate-Axes Rotations
■ X-axis rotation
■ Y-axis rotation
■ Z-axis rotation

■ General 3D Rotations
■ Rotation about an axis that is parallel to one of the coordinate axes
■ Rotation about an arbitrary axis

cgvr.korea.ac.kr
Coordinate-Axes Rotations

■ Z-Axis Rotation ■ X-Axis Rotation ■ Y-Axis Rotation

y y y

x x x
z z z

cgvr.korea.ac.kr
Order of Rotations

■ Order of Rotation Affects Final Position


■ X-axis Z-axis

■ Z-axis X-axis

cgvr.korea.ac.kr
General 3D Rotations

■ Rotation about an Axis that is Parallel to One of the Coordinate


Axes
■ Translate the object so that the rotation axis coincides with the parallel
coordinate axis
■ Perform the specified rotation about that axis
■ Translate the object so that the rotation axis is moved back to its original
position

cgvr.korea.ac.kr
General 3D Rotations

■ Rotation about an Arbitrary Axis


y Basic Idea
T 1. Translate (x1, y1, z1) to the origin
(x2,y2,z2) 2. Rotate (x’2, y2, z2) on to the z axis
R 3. Rotate the object around the z-axis
4. Rotate the axis to the original
(x1,y1,z1)
orientation
x R-1 5. Translate the rotation axis to the
original position
z -1
T

cgvr.korea.ac.kr
General 3D Rotations

■ Step 1. Translation
y

(x2,y2,z2)

(x1,y1,z1)

cgvr.korea.ac.kr
General 3D Rotations

■ Step 2. Establish [ TR ]αx x axis


y

(0,b,c)
(a,b,c)

Projected
Point α α
x

z
Rotated
Point

cgvr.korea.ac.kr
Arbitrary Axis Rotation

■ Step 3. Rotate about y axis by β


y

(a,b,c)

Projected l
Point
d
β x
(a,0,d)
Rotated
z Point

cgvr.korea.ac.kr
Arbitrary Axis Rotation

■ Step 4. Rotate about z axis by the desired angle θ


y

l
x
θ

cgvr.korea.ac.kr
Arbitrary Axis Rotation

■ Step 5. Apply the reverse transformation to place the axis back in


its initial position
y

l
x

cgvr.korea.ac.kr
Example

Find the new coordinates of a unit cube 90º-rotated


about an axis defined by its endpoints A(2,1,0) and
B(3,3,1).

A Unit Cube

cgvr.korea.ac.kr
Example

■ Step1. Translate point A to the origin

B’(1,2,1)

A’(0,0,0)
x
z

cgvr.korea.ac.kr
Example

■ Step 2. Rotate axis A’B’ about the x axis by and angle α, until it
lies on the xz plane.

y
Projected point
(0,2,1) B’(1,2,1)

α l
x
z
B”(1,0,√5)

cgvr.korea.ac.kr
Example

■ Step 3. Rotate axis A’B’’ about the y axis by and angle β, until it
coincides with the z axis.

l x
β
(0,0,√6)
B”(1,0, √ 5)

cgvr.korea.ac.kr
Example

■ Step 4. Rotate the cube 90° about the z axis

■ Finally, the concatenated rotation matrix about the arbitrary axis AB


becomes,

cgvr.korea.ac.kr
Example

cgvr.korea.ac.kr
Example

■ Multiplying R(θ) by the point matrix of the original cube

cgvr.korea.ac.kr
Other Transformations

■ Reflection Relative to the xy Plane

y y

z x x

■ Z-axis Shear

cgvr.korea.ac.kr
Coordinate Transformations

■ Multiple Coordinate System


■ Local (modeling) coordinate system
■ World coordinate scene

Local Coordinate System


cgvr.korea.ac.kr
Coordinate Transformations

■ Multiple Coordinate System


■ Local (modeling) coordinate system
■ World coordinate scene

World Coordinate System


cgvr.korea.ac.kr
Coordinate Transformations

■ Example – Simulation of Tractor movement


■ As tractor moves, tractor coordinate system and front-wheel
coordinate system move in world coordinate system
■ Front wheels rotate in wheel coordinate system

cgvr.korea.ac.kr
Coordinate Transformations

■ Transformation of an Object Description from


One Coordinate System to Another
■ Transformation Matrix
■ Bring the two coordinates systems into alignment
1. Translation
y’
y
u' y x’
y u' x u' y
(x0,y0,z0) u' x
u 'z (0,0,0) x
z’ z u' z
(0,0,0) x
z

cgvr.korea.ac.kr
Coordinate Transformations

2. Rotation & Scaling

y’ y y y
x’ u' u'
u' y y y
u' x u
x (0,0,0)u'x x (0,0,0) 'x x
z (0,0,0) z u' z u'
z’ u'z z z

cgvr.korea.ac.kr

You might also like