0% found this document useful (0 votes)
42 views16 pages

Lec-32 Viewing Transformation and Projection

Uploaded by

imt2022103
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)
42 views16 pages

Lec-32 Viewing Transformation and Projection

Uploaded by

imt2022103
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/ 16

ABV-Indian Institute of Information Technology

and Management Gwalior

Lecture : 32
Viewing Pipeline
(Projection : VCS-Window)

===========================================================================

Instructors – Dr. Sunil Kumar


Office : A – 108 (A-Block) :: Tel No – 0751-2449710 (O)
Email - snk@iiitm.ac.in
4 Forth Stage Viewing Pipeline
(Projection : 3D-to-2D Projection)

Fig.(a) : Perspective Projection Fig.(b) : Parallel Projection


4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
❖ This stage actually projects 3D-scene (comes under view volume) to 2D-
imaging plane (clipping window).

Camera screen
View-volume (view-port)

Clipping area
Object outside the

(Window)
view volume

yw
yv

xw xv
A portion of this object is (0,0,0)
zw outside the view volume zv
4 Forth Stage Viewing Pipeline
(Projection : 3D-to-2D Projection)
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)

yv
Camera screen
yw (view-port)

xv xw 𝑋, 𝑌, 𝑍
𝑝
Center of the lens
𝑜𝑣 , 𝑜𝑤 zw
0,0, 𝜆 A
zv
𝑝′ 𝑍−𝜆
𝑥, 𝑦
𝜆

Figure : Simplified setup for perspective projection where it is assumed that camera
axes are aligned with the world coordinate system.
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
❖ Find the perspective transformation matrix 𝑇𝑝𝑝 that can project any point in
3D-scene (under view volume) to a window port.
❖ We will find the 𝑇𝑝𝑝 in homogenous coordinate system.
𝑘𝑋
𝑋
𝑘𝑌
Scene point : 𝑝 = 𝑌 ⇒ 𝑝ℎ =
𝑘𝑍
𝑍
𝑘
❖ In the previous figure, the two triangles are similar as all the angles of left
triangle are equal to the corresponding angles in right triangle.
So, we can write
𝑥 𝑋 𝑦 𝑌
− = & − =
𝜆 𝑍−𝜆 𝜆 𝑍−𝜆
𝜆𝑋 𝜆𝑌
⇒𝑥= & 𝑦= (1)
𝜆−𝑍 𝜆−𝑍
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
❖ Let us defined the perspective projection matrix of this form :

1 0 0 0
0 1 0 0
𝑇𝑝𝑝 = 0 0 1 0
1
0 0 − 1
𝜆
❖ The projected point on camera coordinate system in homogenous form is :

1 0 0 0
𝑥′ 𝑘𝑋
0 1 0 0
𝑦′ 𝑘𝑌
𝑝′ ℎ = ′ = 𝑇𝑝𝑝 𝑝ℎ = 0 0 1 0
𝑧 1 𝑘𝑍
𝑘′ 0 0 − 1 𝑘
𝜆
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
❖ The projected point on camera coordinate system in homogenous form is :
1 0 0 0
𝑥′ 𝑘𝑋
′ 0 1 0 0
𝑦 𝑘𝑌
𝑝′ ℎ = ′ = 𝑇𝑝𝑝 𝑝ℎ = 0 0 1 0
𝑧 1 𝑘𝑍
𝑘′ 0 0 − 1 𝑘
𝜆
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
❖ The projected point on camera coordinate system in homogenous form is :
1 0 0 0
𝑥′ 𝑘𝑋
′ 0 1 0 0
𝑦 𝑘𝑌
𝑝′ ℎ = ′ = 𝑇𝑝𝑝 𝑝ℎ = 0 0 1 0
𝑧 1 𝑘𝑍
𝑘′ 0 0 − 1 𝑘
𝜆

and
𝑧′ 𝑘𝑍
𝑧= ′=
𝑘 𝑍
𝑘 1−
𝜆
𝑍 𝜆𝑍
= =
𝑍 𝜆−𝑍
1−
𝜆
4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)

❖ *Note : If camera is not aligned with the WCS system, then one needs to
align first and then same perspective projection matrix can be used to project
any scene point to the imaging plane.

❖ This step (aligning camera to the WCS) requires translating the camera to
the origin of WCS, and a series of rotations to align the axes of camera to the
axes of WCS.

❖ Also, there are other types of projection transformation such as parallel


projection (mainly used in CAD design), and orthographic projection, and so
on.
❖ In all these projection schemes, we actually lose the depth (z-coordinate)
information as our imaging plane is 2D.

❖ This step is an ill pose problem.


4 Forth Stage Viewing Pipeline
b (Perspective Projection : 3D-to-2D Projection)
Example – 2 : Given the following data, find the location of scene point 𝑝 = 5,3,3
defined w.r.t. WCS on the window port defined w.r.t VCS. Axes of VCS and WCS are
parallel. Assuming that the point 𝑝 is within the view-volume.

𝑝 = 5,3,3 𝜆 = 2 𝑢𝑛𝑖𝑡
yw yv 𝑝 = 5,3,3
𝑜𝑣 = 2,2,2
𝑜𝑣
xv zv

𝑜𝑤
(0,0,0) zw

xw
4 Forth Stage Viewing Pipeline
❑ Characteristics of Perspective Projection
1. Perspective foreshortening : Two objects of same size placed at
different distances from the view plane, the projected images are
of different sizes. Farther the object, smaller the image and vice-
versa.
2. Vanishing points : Lines that are not parallel to the view plane
appears to meet at some point on the view plane after projection
such points are called vanishing points.
3. View confusion : If the view plane is behind the center of
projection, objects in front of the center of projection appears
upside down on the view plane after projection i.e., inverted
image is formed on the view plane.
Like in page no 5 image

after 13 mins
https://www.youtube.com/watch?v=_EhY31MSbNM&t=329s
4 Forth Stage Viewing Pipeline
c (Parallel Projection)
4 Forth Stage Viewing Pipeline
c (Canonical View Volume : VCS (3D) to CVV
(3D) Projection)
Queries!
Acknowledgment
❖Computer Graphics C Version by Donald D. Hearn and M.
Pauline Baker

❖ Computer Graphics by Samit Bhattacharya

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy