2. 2
of
51
Polyhedra
Objects are simply a set of surface polygons that
enclose an object interior
Simplest and fastest way to render objects
Often referred to as standard graphics objects
In many cases packages allow us to define objects
as curved surfaces etc but actually convert these
to polygon meshes for display
To define polyhedra we simply define the vertices
of the polygons required
4. 4
of
51
Quadric Surfaces
A frequently used class of objects are
quadric surfaces
These are 3D surfaces described using
quadratic equations
Quadric surfaces include:
– Spheres
– Ellipsoids
– Tori
– Paraboloids
– Hyperboloids
5. 5
of
51
Quadric Surfaces - Spheres
A spherical surface with radius r centred on
the origin is defined as the set of points (x,
y, z) that satisfy the equation
This can also be done in parametric form
using latitude and longitude angles
2
2
2
2
r
z
y
x
sin
sin
cos
cos
cos
r
z
r
y
r
x
2
2
7. 7
of
51
Sweep Representations
Sweep representations are useful for
constructing 3 dimensional objects that
possess translational, rotational or other
symmetries
Objects are specified as a 2 dimensional
shape and a sweep that moves that shape
through a region of space
9. 9
of
51
Constructive Solid Geometry Methods
Constructive Solid Geometry (CSG)
performs solid modelling by generating a
new object from two three dimensional
objects using a set operation
Valid set operations include
– Union
– Intersection
– Difference
11. 11
of
51
Constructive Solid Geometry Methods
(cont…)
CSG usually starts with a small set of
primitives such as blocks, pyramids,
spheres and cones
Two objects re initially created and
combined using some set operation to
create a new object
This object can then be combined with
another primitive to make another new
object
This process continues until modelling
complete
12. 12
of
51
Constructive Solid Geometry Methods
(cont…)
CSG
Object
oper1
obj1 obj2
oper3
obj4 oper2
obj2 obj3
CSG models are
usually
represented as
CSG trees
14. 14
of
51
Ray-Casting
Ray-casting is typically used to implement
CSG operators when objects are
described with boundary representations
Ray casting is applied by determining the
objects that are intersected by a set of
parallel lines emanating from the xy plane
along the z axis
The xy plane is referred to as the firing
plane
16. 16
of
51
Ray-Casting (cont…)
Surface intersections along each ray are
calculated and these are sorted according
to distance from the firing plane
The surface limits for the composite object
are then determined by the specified set
operation
18. 18
of
51
Octrees
Octrees are typically used when the interior of
objects is important
Octrees are hierarchical tree structures used
to represent solid objects.
Octrees are particularly
useful in applications that
require cross sectional
views – for example
medical applications.
19. 19
of
51
Octrees & Quadtrees
Octrees are based on a two-dimensional
representation scheme called quadtree
encoding
Quadtree encoding divides a square region
of space into four equal areas until
homogeneous regions are found
These regions can then be arranged in a
tree
22. 22
of
51
Octrees
Quadtree encodings provide considerable
savings in storage when large colour
areas exist in a region of space
An octree takes the same approach as
quadtrees, but divides a cube region of 3D
space into octants
Each region within an octree is referred to
as a volume element or voxel
Division is continued until homogeneous
regions are discovered
24. 24
of
51
Octrees (cont…)
In 3 dimensions regions can be considered
to be homogeneous in terms of colour,
material type, density or any other physical
characteristics
Voxels also have the unique possibility of
being empty
27. 27
of
51
Fractals
All of the modelling techniques covered so
far use Euclidean geometry methods
– Objects were described using equations
This is fine for manufactured objects
But what about natural objects that have
irregular or fragmented features?
– Mountains, clouds, coral…
28. 28
of
51
Fractal Geometry Methods & Procedural
Modelling
Natural objects can be realistically described
using fractal geometry methods. Fractal
methods use procedures rather than
equations to model objects - procedural
modelling
The major characteristic of any procedural
model is that the model is not based on
data, but rather on the implementation of a
procedure following a particular set of rules
Modelling On The Fly!
29. 29
of
51
Fractals
A fractal object has two basic
characteristics:
– Infinite detail at every point
– A certain self similarity
between object parts and the
overall features of the object
The Koch Curve
Mandelbrot Set Video From:
http://fractalanimation.com/
30. 30
of
51
Generating Fractals
A fractal object is generated by repeatedly
applying a specified transform function to
points in a region of space
If P0 = (x0, y0, z0) is a selected initial position,
each iteration of a transformation function
F generates successive levels of detail
with the calculations:
In general the transformation is applied to a
specified point set, or to a set of primitives
(e.g. lines, curves, surfaces)
...
,
,
, 2
3
1
2
0
1 P
F
P
P
F
P
P
F
P
31. 31
of
51
Generating Fractals (cont…)
Although fractal objects, by definition have
infinite detail, we only apply the
transformation a finite number of times
Obviously objects we display have finite
dimension – they fit on a page or a screen
A procedural representation approaches a
true representation as we increase the
number of iterations
The amount of detail is limited by the
resolution of the display device, but we
can always zoom in for further detail
32. 32
of
51
Example: The Koch Snowflake
Images
taken
from
Hearn
&
Baker,
“Computer
Graphics
with
OpenGL”
(2004)
34. 34
of
51
Fractal Dimension
The amount of variation in the structure of a
fractal object is described as the fractal
dimension, D
– More jagged looking objects have larger
fractal dimensions
Calculating the fractal dimension can be
difficult, especially for particularly complex
fractals
We won’t look at the details of these
calculations
35. 35
of
51
Types Of Fractals
Fractals can be classified into three groups
– Self similar fractals
• These have parts that are scaled down versions
of the entire object
• Commonly used to model trees, shrubs etc
– Self affine fractals
• Have parts that are formed with different scaling
parameters in each dimension
• Typically used for terrain, water and clouds
– Invariant fractal sets
• Fractals formed with non-linear transformations
• Mandelbrot set, Julia set – generally not so useful
36. 36
of
51
Random Midpoint Displacement
Methods For Topography
One of the most successful uses of fractal
techniques in graphics is the generation of
landscapes
One efficient method for doing this is
random midpoint displacement
37. 37
of
51
Random Midpoint Displacement
Methods For Topography (cont…)
Easy to do in two dimensions
Easily expanded to three dimensions to
generate terrain
Can introduce a roughness factor H to
control terrain appearance
Control surfaces can be used to start with a
general terrain shape
Terrain generation demo:
http://world.std.com/~bgw/applets/1.02/MtFractal/MtFractal.html
42. 42
of
51
Interpolation Vs Approximation
A spline curve is specified using a
set of control points
There are two ways to fit a curve to
these points:
– Interpolation - the curve passes
through all of the control points
– Approximation - the
curve does not pass
through all of the control
points
Images
taken
from
Hearn
&
Baker,
“Computer
Graphics
with
OpenGL”
(2004)
43. 43
of
51
Convex Hulls
The boundary formed by the set of control
points for a spline is known as a convex hull
Think of an elastic band stretched around the
control points
Images
taken
from
Hearn
&
Baker,
“Computer
Graphics
with
OpenGL”
(2004)
44. 44
of
51
Control Graphs
A polyline connecting the control points in
order is known as a control graph
Usually displayed to help designers keep
track of their splines
Images
taken
from
Hearn
&
Baker,
“Computer
Graphics
with
OpenGL”
(2004)
45. 45
of
51
Bézier Spline Curves
A spline approximation method developed
by the French engineer Pierre Bézier for
use in the design of Renault car bodies
A Bézier curve can be fitted to any number
of control points – although usually 4 are
used
46. 46
of
51
Bézier Spline Curves (cont…)
Consider the case of n+1 control points
denoted as pk=(xk, yk, zk) where k varies
from 0 to n
The coordinate positions are blended to
produce the position vector P(u) which
describes the path of the Bézier
polynomial function between p0 and pn
n
k
n
k
k u
u
BEZ
p
u
P
0
, 1
0
),
(
)
(
47. 47
of
51
Bézier Spline Curves (cont…)
The Bézier blending functions BEZk,n(u) are
the Bernstein polynomials
where parameters C(n,k) are the binomial
coefficients
k
n
k
n
k u
u
k
n
C
u
BEZ
)
1
(
)
,
(
)
(
,
)!
(
!
!
)
,
(
k
n
k
n
k
n
C
48. 48
of
51
Bézier Spline Curves (cont…)
So, the individual curve coordinates can be
given as follows
n
k
n
k
k u
BEZ
x
u
x
0
, )
(
)
(
n
k
n
k
k u
BEZ
z
u
z
0
, )
(
)
(
n
k
n
k
k u
BEZ
y
u
y
0
, )
(
)
(
50. 50
of
51
Important Properties Of Bézier Curves
The first and last control points are the first
and last point on the curve
– P(0) = p0
– P(1) = pn
The curve lies within the convex hull as the
Bézier blending functions are all positive
and sum to 1
1
)
(
0
,
n
k
n
k u
BEZ
51. 51
of
51
Cubic Bézier Curve
Many graphics packages restrict Bézier
curves to have only 4 control points (i.e. n
= 3)
The blending functions when n = 3 are
simplified as follows:
3
3
,
3
2
3
,
2
2
3
,
1
3
3
,
0
)
1
(
3
)
1
(
3
)
1
(
u
BEZ
u
u
BEZ
u
u
BEZ
u
BEZ