Title: Threedimensional Graphics
1Three-dimensional Graphics
- 3D computer graphics involves the additional
dimension of depth, allowing us to make more
realistic and higher fidelity representations of
3D objects in the real world - Paradoxically in most cases this is still
represented in 2D output devices utilising
techniques to render these objects with the
illusion of depth - 3D Graphics is characterised more by the 3D
nature of the Models (input into rendering)
rather than the final display (output) modeling
world
23D Coordinate Systems
- We add a third dimension to our real-world or
modeling coordinate system by adding a z-axis to
our 2D system - There are two possible ways of attaching the
Z-axis - This gives rise to a left-handed or a
right-handed system. - Imagine that the thumb and finger of each hand is
the x and y axis resp. The direction of your
middle finger shows the direction of the z-axis
in each system
3y
y
z
(1,-1,1)
(1,-1,-1)
x
x
Right Handed
Left Handed
z
The Right-handed system is the most commonly used.
4Three Dimensional Issues
- More Complicated Objects than 2D
- bounded by planes and curved surfaces
- have internal/external components
- More involved geometric transformations
- Viewing transformations much more complicated
- Projection onto a two dimensional output display
(usually) - Identification of Visible Surfaces
53D Display Methods
- Two dimensional output device
- projection orthographic/perspective
- depth cueing
- visible line/surface identification
- surface rendering
- exploded/cutaway scenes, cross-sections
- Three-dimensional output
- Stereoscopic displays
- Holograms
6Three Dimensional Concepts
- 3D viewing positions
- projection
- depth cueing
- visible line and visible surface identification
- surface rendering
- three-dimensional views/ stereoscopic views
7Camera Positioning
Different views of a 3D model
8Projection
Representing three dimensions on two dimensional
media by Projection
9Albrecht Dürer (1471-1528).
10Depth Cues
Shadows as depth cues
Perspective and Depth of Field
11Surface Rendering
Light and shadow colour of diferent parts of an
object suggest its three -dimensional nature
12Exploded/cutaway scenes
133D GRAPHICS PIPELINE
WORLD SCENE/OBJECT
Modelling coordinates - world coordinate system,
- object coordinate system
3D MODELLING
VIEWING
3D CLIPPING
Camera coordinates
PROJECTION
Screen/Window coordinates
RASTERIZATION
Device coordinates
2D PIXELMAP DISPLAY
14Modelling
Polygonal
Implicit
3D Modelling
Particles
Parametric
15Clipping 3D
view frustrum
outside view so must be clipped
16Viewing and Projection
3d models
camera setup
viewport
17Rasterization
183D Modelling
- Two Broad categories of representation of Solids
- Boundary Representations (B-reps) describe
objects as a set of surfaces that separate the
object interior from the environment - Space Partitioning representations describe the
object as a set of small, non-overlapping
contiguous solids - Polygonal Representations
- Constructive Solid Geometry
19Representation Schemes
- Surface
- Polygon meshes/Polygon Tables
- Plane Equations
- Parametric Surfaces
- Implicit Surface
- Volume
- Voxel arrays
- Octrees
203D Modelling
Polygonal Representation
Tessellation or polygonisation
B-rep or boundary representation model
Geometry defined by the sub-space bounded by sets
of planes and surfaces.
213D Modelling
Volumetric model.
CSG - constructive solid geometry
3D Object is a collection of volume elements or
voxels which flag spatial occupancy in a discrete
region.
3D Objects defined as boolean operations on solid
primitives.
223D Modeling with Polygons
- We construct 3D models using groups of polygons.
- Each polygon is planar ? we need a large number
of small polygons to give the impression of
curved surfaces
48 polygons
120 polygons
300 polygons
1000 polygons
23Polygon Mesh
24Polygon Mesh
25CSG by boolean operations
26CSG Tree
27Octree
Quadtree
Partially occupied (further decomposition
required)
283D Matrix Transformations
- The translation, scaling and rotation
transformations used for 2D can be extended to
three dimensions - Again, using homogeneous coordinates it is
possible to represent each type of transformation
in a matrix form - In 3D, each transformation is represented by a
4x4 matrix
293D Scaling and Translation
The elementary Affine Transformations of
translation and scaling may now be represented in
3D as follows
Translation
SX 0 0 0 0 SY 0 0 0 0 SZ
0 0 0 0 1
)
(
Scaling
30Rotation
- In 2D, the only rotation possible was about the
origin. - In 3D, there are 3 possible rotations, one about
each of the x, y and z axes - Positive rotations are anti-clockwise, negative
rotations are clockwise, when looking down a
positive axis towards the origin
y
x
z
31Major Axis Rotation Matrices
- X axis rotation
- Y Axis Rotation
- Z Axis Rotation
32Rotation about Arbitrary Axes
- We obtain the relevant transformation matrix by
composition of rotations about the major axes
Rotate about y axis by to align vector with
yz plane
Rotate about x axis by to align vector with
xy plane
y
a
b
y
x
a
b
z
z
33Rotation about Arbitrary Axes
y
N(nx, ny, nz)
x
b
z
a
d
343D Viewing
- Inherently more complex than 2D process
- Part of the difficulty lies in trying to display
three dimensional objects on a 2D display - Different views on the same object eventually
lead to different 2D representations at the
projection stage - the projected 2D image of a 3D object is viewer
dependent - Different views can be specified based on several
parameters e.g. position, orientation, field of
view
35Different Views
36The Viewing Process
- To create a view of a scene we need
- a description of the scene geometry
- a view definition (camera)
- We need to transform the 3D objects onto a 2D
plane - A real-world window is defined on this plane
- This window is then mapped to the viewport as in
2D viewing - The camera definition allows projection of the 3D
scene geometry onto a 2D surface for display.
37Camera Analogy
- View described in terms of
- camera location position in world co-ordinate
system - direction in which we are aiming the camera
viewing direction - orientation of the camera usually defined by the
up vector - aperture size field of view
38Viewing Coordinates
- Often useful to look at the model in terms of the
Viewing Co-ordinate system defined by the viewing
parameters defined by - View Reference Point (VRP) origin of our viewing
system (position of the camera) - View Plane Normal vector (VPN) viewing
direction) - View UP vector (VUP) establishes orientation of
camera
Three mutually orthogonal basis vectors
393D Viewing Transformation
- Based on these vectors and the Viewing Reference
Point (x0, y0, z0) the Viewing Transformation can
be defined by composition of the following two
transformations
This is used to determine the location of each
vertex in the camera co-ordinate system
40Viewing Transformation
- We might also achieve this in terms of the
following transformation sequence - Translate the view reference point to the origin
of the world co-ordinate system - Apply Rotations to align xv, yv and zv, axes,
respectively
(x0, y0, z0)
41Projections
- After a view has been defined we need to project
onto a 2D Viewplane - The projections used to display 3D objects in 2D
are called Planar Geometric Projections - For computer graphics, the main types of
projection used are - Perspective Projection defined by a Centre Of
Projection (COP) and a projection plane - Parallel Projections defined by a Direction Of
Projection and a projection plane
42Parallel Projections
- Classified as orthographic or oblique
- The DOP makes 2 angles with the projection plane
- Orthographic means DOP is perpendicular to the
projection plane, I.e. both angles are 90 degrees - Oblique means DOP not perpendicular, I.e. one or
both angles are not equal to 90 degrees.
43Parallel Projections
orthographic
oblique
isometric
axonometric
44Parallel Projections
- The simplest of all projections, parallel project
onto view-plane. - Usually view-plane is axis aligned (often at z0)
45Parallel Projections
- The result is an orthographic projection if the
object is axis aligned, otherwise it is an
axonometric projection. - If the projection plane intersects the principle
axes at the same distance from the origin the
projection is isometric.
46Parallel Projection
47General Parallel Projection
- Orthographic projections d0
- Although we can use any a, f, there are some
common values for the angles - If tan a1 cavalier projection (all lengths along
major axis are preserved) Cavalier - If tan a2 all z-axis lengths are halved
(slightly more realistic) we have a
CabinetProjection - Common values for f are 30º or 45º which display
a combination view of front, side and top (or
front, side and bottom)
48Oblique Projections
D/2
D
D
Cabinet Projection
Cavalier Project
49Perspective Projection
- Perspective projections produce a perspective
foreshortening effect - They tend, therefore, to appear more realistic
that parallel projections - Parallel lines in the 3D model which are not
parallel to the projection plane, converge to a
vanishing point
50Perspective Projections
- If the vanishing point lies on a principle axis,
it is called a principle vanishing point - The number of principal vanishing points is
determined by the number of principal axes cut by
the projection plane. - If the plane only cut the z axis (most common),
there is only 1 vanishing point. - 2-points sometimes used in architecture and
engineering. 3-points seldom used add little
extra realism
51Perspective Projections
3-point perspective
1-point perspective
2-point perspective
52Perspective Projections
- Parameters
- centre of projection (COP)
- field of view (q, f)
- projection direction
- up direction
53Perspective Projections
Consider a perspective projection with the
viewpoint at the origin and a viewing direction
oriented along the positive -z axis and
the view-plane located at z -d
a similar construction for xp ?
d
y
yp
-z
divide by homogenous ordinate to map back to 3D
space
54Perspective Projection Details
Flip z to transform to a left handed
co-ordinate system ? increasing z values mean
increasing distance from the viewer.