SlideShare a Scribd company logo
Sudipta Mondal
Computer Graphics 7:
Transformation &
Viewing in 3-D
2
of
23
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
3-D Coordinate Spaces
Remember what we mean by a 3-D
coordinate space
x axis
y axis
z axis
P
y
z
x
Right-Hand
Reference System
3
of
23
Translations In 3-D
To translate a point in three dimensions by
dx, dy and dz simply calculate the new
points as follows:
x’ = x + dx y’ = y + dy z’ = z + dz
(x’, y’, z’)
(x, y, z)
Translated Position
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
4
of
23
Scaling In 3-D
To sale a point in three dimensions by sx, sy
and sz simply calculate the new points as
follows:
x’ = sx*x y’ = sy*y z’ = sz*z
(x, y, z)
Scaled Position
(x’, y’, z’)
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
5
of
23
Rotations In 3-D
When we performed rotations in two
dimensions we only had the choice of
rotating about the z axis
In the case of three dimensions we have
more options
– Rotate about x – pitch
– Rotate about y – yaw
– Rotate about z - roll
6
of
23
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
Rotations In 3-D (cont…)
x’= x·cosθ - y·sinθ
y’= x·sinθ + y·cosθ
z’= z
x’= x
y’= y·cosθ - z·sinθ
z’= y·sinθ + z·cosθ
x’= z·sinθ + x·cosθ
y’= y
z’= z·cosθ - x·sinθ
The equations for the three kinds of
rotations in 3-D are as follows:
7
of
23
Homogeneous Coordinates In 3-D
Similar to the 2-D situation we can use
homogeneous coordinates for 3-D
transformations - 4 coordinate
column vector
All transformations can
then be represented
as matrices
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é
1
z
y
x
x axis
y axis
z axis
P
y
z
xP(x, y, z) =
8
of
23
3D Transformation Matrices
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é
1000
100
010
001
dz
dy
dx
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é
1000
000
000
000
z
y
x
s
s
s
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é
-
1000
0cos0sin
0010
0sin0cos
qq
qq
Translation by
dx, dy, dz
Scaling by
sx, sy, sz
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é
-
1000
0cossin0
0sincos0
0001
qq
qq
Rotate About X-Axis
ú
ú
ú
ú
û
ù
ê
ê
ê
ê
ë
é -
1000
0100
00cossin
00sincos
qq
qq
Rotate About Y-Axis Rotate About Z-Axis
9
of
23
Remember The Big Idea
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
10
of
23
What Are Projections?
Our 3-D scenes are all specified in 3-D
world coordinates
To display these we need to generate a 2-D
image - project objects onto a picture plane
So how do we figure out these projections?
Picture Plane
Objects in
World Space
11
of
23
Converting From 3-D To 2-D
Projection is just one part of the process of
converting from 3-D world coordinates to a
2-D image
Clip against
view volume
Project onto
projection
plane
Transform to
2-D device
coordinates
3-D world
coordinate
output
primitives
2-D device
coordinates
12
of
23
Types Of Projections
There are two broad classes of projection:
– Parallel: Typically used for architectural and
engineering drawings
– Perspective: Realistic looking and used in
computer graphics
Perspective ProjectionParallel Projection
13
of
23
Types Of Projections (cont…)
For anyone who did engineering or technical
drawing
14
of
23
Parallel Projections
Some examples of parallel projections
Orthographic Projection
Isometric Projection
15
of
23
Isometric Projections
Isometric projections have been used in
computer games from the very early days of
the industry up to today
Q*Bert Sim City Virtual Magic Kingdom
16
of
23
Perspective Projections
Perspective projections are much more
realistic than parallel projections
17
of
23
Perspective Projections
There are a number of different kinds of
perspective views
The most common are one-point and two
point perspectives
ImagestakenfromHearn&Baker,“ComputerGraphicswithOpenGL”(2004)
One Point Perspective
Projection
Two-Point
Perspective
Projection
18
of
23
Elements Of A Perspective Projection
Virtual
Camera
19
of
23
The Up And Look Vectors
The look vector
indicates the direction in
which the camera is
pointing
The up vector
determines how the
camera is rotated
For example, is the camera held vertically or
horizontally
Up vector
Look vector
Position
Projection of
up vector

More Related Content

PPTX
3 d transformation
PPTX
3D transformation in computer graphics
PPT
transformation 3d
PPTX
Computer graphics presentation
PPTX
3D TRANSFORMATION: MATRIX REPRESENTATION
PPTX
3 d transformation
PPTX
3D Transformation
PPTX
3D Graphics : Computer Graphics Fundamentals
3 d transformation
3D transformation in computer graphics
transformation 3d
Computer graphics presentation
3D TRANSFORMATION: MATRIX REPRESENTATION
3 d transformation
3D Transformation
3D Graphics : Computer Graphics Fundamentals

What's hot (20)

PPTX
3D transformation and viewing
PPTX
3D Transformation in Computer Graphics
PPT
2d/3D transformations in computer graphics(Computer graphics Tutorials)
PPTX
3 d transformation
PPTX
3D Transformation
PPTX
Homogeneous Representation: rotating, shearing
PPT
3 d transformations
PPT
3 D Graphics
PPTX
3d transformation computer graphics
PPTX
Three dimensional transformations
PPT
Three dimensional concepts - Computer Graphics
PPTX
Geometric transformations and projections
PPT
Projection Matrices
PPT
Modeling Transformations
PPS
Overview of 2D and 3D Transformation
PPT
Composite transformations
PPT
3 d transformations
PPT
viewing3d pipeline
PPTX
Computer Graphic - Transformations in 2D
3D transformation and viewing
3D Transformation in Computer Graphics
2d/3D transformations in computer graphics(Computer graphics Tutorials)
3 d transformation
3D Transformation
Homogeneous Representation: rotating, shearing
3 d transformations
3 D Graphics
3d transformation computer graphics
Three dimensional transformations
Three dimensional concepts - Computer Graphics
Geometric transformations and projections
Projection Matrices
Modeling Transformations
Overview of 2D and 3D Transformation
Composite transformations
3 d transformations
viewing3d pipeline
Computer Graphic - Transformations in 2D
Ad

Viewers also liked (8)

PDF
PPT
Hearn and Baker 2 D transformations
PPTX
2 d transformations and homogeneous coordinates
PPTX
3D Geometric Transformations
PPT
2 d transformations by amit kumar (maimt)
PPT
2 d geometric transformations
PDF
Notes 2D-Transformation Unit 2 Computer graphics
PPT
Composite preparation
Hearn and Baker 2 D transformations
2 d transformations and homogeneous coordinates
3D Geometric Transformations
2 d transformations by amit kumar (maimt)
2 d geometric transformations
Notes 2D-Transformation Unit 2 Computer graphics
Composite preparation
Ad

Similar to Lect8 viewing in3d&transformation (20)

PPT
Transformations Matrix Representations-2.ppt
PPTX
TYPES OF TRANSFORMATIONS IN COMPUTER GRAPHICS.pptx
PDF
Theories and Engineering Technics of 2D-to-3D Back-Projection Problem
PDF
2 transformation computer graphics
PPT
Windows and viewport
PDF
3 projection computer graphics
PPTX
UNIT 1 2D AND 3Dtransformations hiutu h.pptx
PDF
Saad alsheekh multi view
DOCX
Computer graphics
PDF
Lec15 sfm
PDF
Computer Graphics & linear Algebra
PPT
Drawing Tools
PDF
Deep Learning for Computer Vision: Attention Models (UPC 2016)
PPTX
Three dimensional graphics
PDF
6. Perspective Projection .pdf
PDF
3Dshape Analysis Matching Ajmmmmmmmmmmmmm
PDF
Slides: Perspective click-and-drag area selections in pictures
PDF
Deep single view 3 d object reconstruction with visual hull
PPTX
Cs8092 computer graphics and multimedia unit 3
PDF
Computer graphics 2
Transformations Matrix Representations-2.ppt
TYPES OF TRANSFORMATIONS IN COMPUTER GRAPHICS.pptx
Theories and Engineering Technics of 2D-to-3D Back-Projection Problem
2 transformation computer graphics
Windows and viewport
3 projection computer graphics
UNIT 1 2D AND 3Dtransformations hiutu h.pptx
Saad alsheekh multi view
Computer graphics
Lec15 sfm
Computer Graphics & linear Algebra
Drawing Tools
Deep Learning for Computer Vision: Attention Models (UPC 2016)
Three dimensional graphics
6. Perspective Projection .pdf
3Dshape Analysis Matching Ajmmmmmmmmmmmmm
Slides: Perspective click-and-drag area selections in pictures
Deep single view 3 d object reconstruction with visual hull
Cs8092 computer graphics and multimedia unit 3
Computer graphics 2

More from BCET (17)

PDF
Lect11 clipping in3d
PDF
Lect9 transformation3d
PDF
Lect7 viewing in2d
PDF
Lect6 transformation2d
PDF
Lect5 filling color_models
PDF
Lect4 ellipse
PDF
Lect2 scan convertinglines
PDF
Lect3 bresenham circlesandpolygons
PDF
Lect2 scan convertinglines
PPTX
Light pens
PPTX
Lcd
PPT
Graphics inputdevices
PPT
Crt
PPTX
Colour models
PPT
Cathode ray tube
PPTX
Plasma display pannel
DOC
php&mysql with Ethical Hacking
Lect11 clipping in3d
Lect9 transformation3d
Lect7 viewing in2d
Lect6 transformation2d
Lect5 filling color_models
Lect4 ellipse
Lect2 scan convertinglines
Lect3 bresenham circlesandpolygons
Lect2 scan convertinglines
Light pens
Lcd
Graphics inputdevices
Crt
Colour models
Cathode ray tube
Plasma display pannel
php&mysql with Ethical Hacking

Lect8 viewing in3d&transformation