Professional Documents
Culture Documents
DV-5
DV-5
DV-5
Data Visualization
Lecture –5
• Intro to Transformations
• Classes of Transformations
• Representing Transformations
• Combining Transformations
Data Visualization
Lecture –6
Projection Transformations
(Orthonormal and Perspective)
Dr Pavan Chakraborty
IIIT-Allahabad
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Taxonomy of Projections
View
Plane
DOP
Front
Top Side
Cavalier Cabinet
o o
(DOP φ = 45 ) (DOP φ = 63.4 )
tan(φ) = 1 tan(φ) = 2
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Orthographic Projection
• Simple Orthographic
Transformation
top=20 m
(height in pixels)
(0, 0)
bottom=10 m
(width in pixels)
1-Point
Perspective
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Perspective Projection
2-Point 1-Point
Perspective Perspective
3-Point
Perspective
f
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Perspective Projection
• When we do 3-D graphics, we think of the
screen as a 2-D window onto the 3-D world:
P (x, y, z)
f
z
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Perspective Projection
′ ′
From simple relations of right angle triangles: = =
P (x, y, z)
′= . . ′= .
.
P’ (x’, y’, z’=f )
′= . =
f
z
𝒛
𝒛
𝒛
𝒛
𝒙
𝒚
𝒙

𝒇
𝒚

𝒇
𝒛

𝒇
𝒇
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝒇
𝒙

𝒚

𝒙
𝒚
𝒛
Perspective Projection
′ ′
= = ′= . . ′= . .
′= . = What could a matrix look like to do
this?
1 0 0 0
0 1 0 0
=
𝑓
0 0 1 0
1
0 0 0
𝑝
𝑒
𝑟
𝑠
𝑝
𝑒
𝑐
𝑡
𝑖
𝑣
𝑒
𝑀
𝑧
𝑧
𝑥
𝑧
𝑦
𝑧
𝑧

𝑓
𝑓
𝑥

𝑓
𝑦

𝑓
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝑓
𝑥

𝑦

𝑧
𝑥
𝑦
Perspective Projection
′ ′
= = ′= . . ′= . .
′= . = What could a matrix look like to do
this?
1 0 0 0
0 1 0 0
=
𝑓
0 0 1 0
1
0 0 0
𝑝
𝑒
𝑟
𝑠
𝑝
𝑒
𝑐
𝑡
𝑖
𝑣
𝑒
𝑀
𝑧
𝑧
𝑥
𝑧
𝑦
𝑧
𝑧

𝑓
𝑓
𝑥

𝑓
𝑦

𝑓
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝑓
𝑥

𝑦

𝑧
𝑥
𝑦
A Perspective Projection Matrix
• Example:
′ 1 0 0 0
′ 0 1 0 0
= = 1 0
′ 0 0
1
′ 0 0 0 1
• Parallel projection
+ Good for exact measurements
+ Parallel lines remain parallel
– Angles are not (in general) preserved
– Less realistic looking
Viewing Transformations
Dr Pavan Chakraborty
IIIT-Allahabad
• Camera is at origin
• Camera is looking along negative z-axis
• Camera’s ‘up’ is aligned with y-axis
→
=
→
=
→
−
Look At Point
World
Coordinate
𝒛
𝒛
𝒛
𝑬
𝑬
𝑼
𝒚
𝒑
𝒚
𝒆
𝒆
𝒕
𝒛
𝒛
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝒚
𝒚
𝒚
𝒚
𝒚
𝑬
𝑼
𝑬
𝒑
𝒚
𝒚
𝒆
𝒆
𝒍
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝒙
𝒙
𝒙
𝑬
𝑼
𝒑
𝒚
𝒆
𝒙
𝒙
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝑬
𝑼
𝑬
𝒑
𝒚
𝒚
𝒆
𝒆
Constructing Viewing
Transformation
• Create a vector from eye-point to look at-point
^ =− ^
𝑒
𝑦
𝑒
𝑧
𝑙
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Constructing Viewing
Transformation,
• Construct another important vector from the
cross product of the lookat-vector and the
vup-vector
^ = ^
𝑒
𝑦
𝑒
𝑥
𝑟
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Constructing Viewing
Transformation
• Multiply it through
Eye
= −
𝑒
𝑦
𝑒
𝑤
𝑜
𝑟
𝑙
𝑑
𝑒
𝑦
𝑒
𝑒
𝑦
𝑒
𝑙
𝑥
𝑙
𝑦
𝑙
𝑧
𝑙
𝑒
𝑦
𝑒
1
𝑙
𝑧
𝑒
𝑦
𝑒
World
𝑧
1
𝑙
𝑢
𝑧
𝑢
𝑒
𝑦
𝑒
𝑢
𝑥
𝑢
𝑦
𝑦
𝑢
𝑒
𝑦
𝑒
𝑢
𝑦
𝑥
𝑟
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝑟
𝑥
𝑟
𝑦
𝑟
𝑧
𝑟
𝑒
𝑦
𝑒
𝑟
𝑒
𝑦
𝑒
𝑥
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
CAMERA
A
Pivot
Pendulum
→
=
→
=
→
−
Look At Point
World
Coordinate
𝒛
𝒛
𝒛
𝑬
𝑬
𝑼
𝒚
𝒑
𝒚
𝒆
𝒆
𝒕
𝒛
𝒛
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝒚
𝒚
𝒚
𝒚
𝒚
𝑬
𝑼
𝑬
𝒑
𝒚
𝒚
𝒆
𝒆
𝒍
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝒙
𝒙
𝒙
𝑬
𝑼
𝒑
𝒚
𝒆
𝒙
𝒙
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝑬
𝑼
𝑬
𝒑
𝒚
𝒚
𝒆
𝒆
^ =−^
^ = ^ ^ = ^
Eye Point /
Camera Point
: →
=
→ :
→ =
: − Look At Point
:
→
:
= . ^
→
n-D
= . ^
Coordinates
𝒏
𝒏
𝒏
𝑬
𝑬
𝑼
𝒑
𝒚
𝒚
𝒆
𝒆
𝒏
𝒏
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝑒
𝑦
𝑒
𝑥
𝑦
𝑒
𝑒
𝑒
𝑦
𝑦
𝑦
𝑒
𝑒
𝑒
𝑒
𝑦
𝑒
𝑧
𝑙
𝟐
𝟐
𝟐
𝑣
𝑣
𝑣
𝑣
𝒍
𝑥
𝑦
𝑥
𝑢
𝑟
𝑦
𝟐
𝟐
𝑬
𝑬
𝑼
𝒑
𝒚
𝒚
𝒆
𝒆
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
𝟏
𝟏
𝟏
𝑬
𝑼
𝒑
𝒚
𝒆
𝟏
𝟏
𝑳
𝒐
𝒐
𝒌
𝑳
𝑨
𝒐
𝒕
𝒐
𝒌
𝑨
𝒕
𝑬
𝑬
𝑼
𝒑
𝒚
𝒚
𝒆
𝒆
Dr. Pavan Chakraborty, Indian Institute of Information Technology - Allahabad
Indian Institute of Information Technology - Allahabad
Indian Institute of Information Technology - Allahabad