You are on page 1of 27

Ho Chi Minh City University of Technology

Faculty of Mechanical Engineering

GEOMETRIC MODELING AND


SIMULATION
Chapter 03

CÁC PHÉP BIẾN ĐỔI HÌNH HỌC 3D


3D GEOMETRIC TRANSFORMATIONS

 Thân Trọng Khánh Đạt


20 September 2022
GEOMETRIC TRANSFORMATION
1. Introduction

2. 2D transformation
• Translation
• Scaling
• Rotating
• Reflection
• Shearing

2. 3D transformation
• Translation
• Scaling
• Rotating
• Reflection/Plane symmetry

C03. 3D Geometric Transformations 2/30 Geo. Model. & Sim. - T.T.K. DAT
Introduction to 3D Transformations (1)
▪ The geometric transformations play a vital role in
generating images of three-dimensional objects with
the help of these transformations.
▪ The location of objects relative to others can be easily
expressed.
▪ Sometimes viewpoint changes rapidly, or sometimes
objects move in relation to each other.
▪ This number of transformations can be carried out
repeatedly.

C03. 3D Geometric Transformations 3/30 Geo. Model. & Sim. - T.T.K. DAT
Introduction to 3D Transformations (2)
▪ 3D COORDINATE

C03. 3D Geometric Transformations 4/30 Geo. Model. & Sim. - T.T.K. DAT
Introduction to 3D Transformations (3)
▪ Understanding left- or right-handed coordinate systems

Left-handed coordinates Right-handed coordinates

Right-hand rule for curve orientation

C03. 3D Geometric Transformations 5/30 Geo. Model. & Sim. - T.T.K. DAT
Introduction to 3D Transformations (4)

C03. 3D Geometric Transformations 6/30 Geo. Model. & Sim. - T.T.K. DAT
Introduction to 3D Transformations (5)
Represent three-dimensional coordinates
▪ Cartesian coordinate system
▪ Point
𝑃 𝑝 = 𝑥1 𝑦1 𝑧1
▪ Line
𝑥1 𝑦1 𝑧1
𝑃 𝑙𝑖𝑛𝑒 = 𝑥 𝑦2 𝑧2
2
▪ Triangle
𝑥1 𝑦1 𝑧1 Tree-dimensional
𝑃 𝑡𝑟𝑖𝑎𝑛𝑔𝑙𝑒 = 𝑥2 𝑦2 𝑧2 coordinates of Tetrahedral
𝑥3 𝑦3 𝑧3
▪ Homogeneous coordinate system
▪ Triangle 0 0 0 1
𝑥1 𝑦1 𝑧1 1 𝑥 0 0 1
𝑃 𝑇𝑒𝑡𝑟𝑎ℎ𝑒𝑑𝑟𝑎𝑙 = 𝐵
𝑃 𝑡𝑟𝑖𝑎𝑛𝑔𝑙𝑒 = 𝑥2 𝑦2 𝑧2 1 0 𝑦𝐶 0 1
𝑥3 𝑦3 𝑦3 1 0 0 𝑧𝐷 1

C03. 3D Geometric Transformations 7/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Translation
𝑥 ∗ = 𝑥 + 𝑇𝑥
▪ Translation of point: ൞𝑦 ∗ = 𝑦 + 𝑇𝑦
𝑧 ∗ = 𝑧 + 𝑇𝑧
1 0 0 0
0 1 0 0
▪ Translation Matrix: 𝑇 𝑇 = 0 0 1 0
𝑇𝑋 𝑇𝑌 𝑇𝑍 1
▪ Matrix form of point after translation: 𝑃∗ = 𝑃 𝑇 𝑇
1 0 0 0
∗ ∗ ∗ 0 1 0 0
𝑥 𝑦 𝑧 1 = 𝑥 𝑦 𝑧 1
0 0 1 0
𝑇𝑋 𝑇𝑌 𝑇𝑍 1

C03. 3D Geometric Transformations 8/30 Geo. Model. & Sim. - T.T.K. DAT
Example 3.1

Let a tetrahedral with vertices have coordinates


A(0,0.0) B(3,0,0), C(0,2,0) and D(0,0,1). Determine the
coordinates of the tetrahedral vertices after the
translation with T𝑥 = T𝑦 = 3, Tz = 1

C03. 3D Geometric Transformations 9/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Scaling
Scaling about Origin
▪ Expression form
𝑥 ∗ = 𝑥𝑆𝑥
𝑦 ∗ = 𝑦𝑆𝑦
𝑧 ∗ = 𝑧𝑆𝑧
▪ Matrix form:
𝑃∗ = 𝑃 𝑇 𝑆𝑂
𝑆𝑋 0 0 0
𝑥∗ 𝑦∗ 𝑧∗ 1 = 𝑥 𝑦 𝑧 1 0 𝑆𝑌 0 0
0 0 𝑆𝑍 0
0 0 0 1

C03. 3D Geometric Transformations 10/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Scaling
Scaling about an arbitrary point
▪ Step 1: Translate point (x, y, z) to origin with [T]T
▪ Step 2: Scale about the origin [T]SO
▪ Step 3: Translation back to its original position [T]T -1
▪ Scale matrix: 𝑇 𝑆 = 𝑇 𝑇 𝑇 𝑆𝑂 𝑇 −1 𝑇
𝑥∗ 𝑦∗ 𝑧∗ 1 = 𝑥 𝑦 𝑧 1 𝑇 𝑆
= 𝑥 𝑦 𝑧 1 𝑇 𝑇 𝑇 𝑆𝑂 𝑇 −1
𝑇

C03. 3D Geometric Transformations 11/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Scaling
Scaling about an arbitrary point

C03. 3D Geometric Transformations 12/30 Geo. Model. & Sim. - T.T.K. DAT
Example 3.2

Let a tetrahedral with vertices have coordinates A(0,0.0)


B(3,0,0), C(0,2,0) and D(0,0,1). Determine the coordinates of the
tetrahedral vertices after the scale with S𝑥 = S𝑦 = 3, Sz =0.5:
a) About the origin A
b) About the point B

C03. 3D Geometric Transformations 13/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotate about Z-axis
▪ Expression form:
𝑥 ∗ = 𝑥 ⋅ cos𝜃 − 𝑦 ⋅ sin𝜃
𝑦 ∗ = 𝑥 ⋅ sin𝜃 + 𝑦 ⋅ cos𝜃
𝑧∗ = 𝑧
▪ Matrix form (CCW):
𝑃∗ = 𝑃 𝑇 𝜃𝑅𝑍
cos𝜃 sin𝜃 0 0
−sin𝜃 cos𝜃 0 0
𝑇 𝜃𝑅𝑍 =
0 0 1 0
0 0 0 1

C03. 3D Geometric Transformations 14/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotate about Y-axis
▪ Expression form:
𝑥 ∗ = 𝑥 ⋅ cos𝜃 + 𝑧 ⋅ sin𝜃
𝑦∗ = 𝑦
𝑧 ∗ = −𝑥 ⋅ sin𝜃 + 𝑧 ⋅ cos𝜃
▪ Matrix form (CCW):
𝑃∗ = 𝑃 𝑇 𝜃𝑅𝑌
cos𝜃 0 −sin𝜃 0
𝜃 0 1 0 0
𝑇 𝑅𝑌 =
sin𝜃 0 cos𝜃 0
0 0 0 1

C03. 3D Geometric Transformations 15/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotate about X-axis
▪ Expression form:
𝑥∗ = 𝑥
𝑦 = 𝑦 ⋅ cos𝜃 − 𝑧 ⋅ sin𝜃
𝑧 ∗ = 𝑦 ⋅ sin𝜃 + 𝑧 ⋅ cos𝜃
▪ Matrix form (CCW):
𝑃∗ = 𝑃 𝑇 𝜃𝑅𝑋
1 0 0 0
𝜃 0 cos𝜃 sin𝜃 0
𝑇 𝑅𝑋 =
0 −sin𝜃 cos𝜃 0
0 0 0 1

C03. 3D Geometric Transformations 16/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation Matrix about axis
CCW CW

C03. 3D Geometric Transformations 17/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis
The point (x, y, z) is to be rotated
▪ The (xc yc zc) is a point about which counterclockwise
rotation is done
▪ Translate the object to the origin
▪ Rotate object so that axis of object coincide with any of
coordinate axis.
▪ Perform rotation about co-ordinate axis with whom
coinciding is done.
▪ Apply inverse rotation to bring rotation back to the original
position.

C03. 3D Geometric Transformations 18/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis

C03. 3D Geometric Transformations 19/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis

C03. 3D Geometric Transformations 20/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis

C03. 3D Geometric Transformations 21/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis

C03. 3D Geometric Transformations 22/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
Rotation about an arbitrary axis

C03. 3D Geometric Transformations 23/30 Geo. Model. & Sim. - T.T.K. DAT
3D Transformations - Rotation
3D rotate about line OP

C03. 3D Geometric Transformations 24/30 Geo. Model. & Sim. - T.T.K. DAT
Example 3.3

Let triangle ABC with the coordinates of vertices A (0,


0), B (1, 3), C (-2, 2) as shown in Figure 1. Find the
coordinates of vertex B after a 90 degree CCW
rotation about AC.

C03. 3D Geometric Transformations 25/30 Geo. Model. & Sim. - T.T.K. DAT
Exercise 3.1

Let a tetrahedral with vertices have coordinates A(0,0.0) B(3,0,0), C(0,2,0)


and D(0,0,1).
Determine the coordinates of the tetrahedral vertices after the rotate:
a) About the line BA with 90° CCW
b) About the CM, M is middle of BD with 90° CCW

C03. 3D Geometric Transformations 26/30 Geo. Model. & Sim. - T.T.K. DAT
QUESTION & ANSWER

C03. 3D Geometric Transformations 27/30 Geo. Model. & Sim. - T.T.K. DAT

You might also like