Labs:
Wednesday 10:00 11:00 (A305) Wednesday 17:00 18:00 (Aungier St. 1-005)
3 of 23
Contents
In todays lecture we are going to have a look at:
Transformations in 3-D
How do transformations in 3-D work? 3-D homogeneous coordinates and matrix based transformations
Projections
History Geometrical Constructions Types of Projection Projection in Computer Graphics
4 of 23
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
x axis
5 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:
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
x = x + dx
y = y + dy
z = z + dz
6 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:
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
x = sx*x
y = sy*y
z = sz*z
(x, y, z)
(x, y, z)
Scaled Position
7 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
8 of 23
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
9 of 23
x axis
10 of 23
3D Transformation Matrices
0 0 dx 1 0 dy 0 1 dz 0 0 1
cos 0 sin 0
sx 0 0 0
0 sin
0 1 0 0 0 cos 0 0 0 1
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
11 of 23
12 of 23
13 of 23
14 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
Parallel Projection
Perspective Projection
15 of 23
16 of 23
Parallel Projections
Some examples of parallel projections
Orthographic Projection
Isometric Projection
17 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
18 of 23
Perspective Projections
Perspective projections are much more realistic than parallel projections
19 of 23
Perspective Projections
There are a number of different kinds of perspective views The most common are one-point and two point perspectives
Images taken from Hearn & Baker, Computer Graphics with OpenGL (2004)
20 of 23
Virtual Camera
21 of 23
Projection of up vector
Position
The look vector indicates the direction in which the camera is pointing The up vector determines how the
22 of 23
Summary
In todays lecture we looked at:
Transformations in 3-D
Very similar to those in 2-D
Projections
3-D scenes must be projected onto a 2-D image plane Lots of ways to do this
Parallel projections Perspective projections
23 of 23