Computer Graphics
Modelling
Richard Ntwari
Institute of Computer Science
Mbarara University of Science and Technology (MUST)
P.O. Box 1410, Mbarara, Uganda
http://www.must.ac.ug/
Email: rntwari@must.ac.ug
The Graphics Process
Lighting
Information
3D geometric
models
Image storage
Rendering &
display
3D Animation
Definition
Texture
Information
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Geometrical Modeling
3D Scanning
Interactive Geometric
Modeling
3D geometric Rendering
models
Model Libraries
Displacement
Mapping
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Geometrical Modeling
Modeling is the process of creating shape
and form on the screen.
Points, curves and surfaces are the basic
geometric elements that can be used in
creating 3D objects.
Three types of geometry for building models:
– NURBS primitives
– Polygons primitives
– Subdivision primitives
– Beizer surfaces
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Geometrical modeling
Points are defined in three dimensions using
X,Y,Z coordinates.
Curves are defined when two or more points
are connected. They are useful for defining
the shape of an object.
Surfaces are formed when a series of lines is
connected in two directions.
Objects are formed when a series of surface
are positioned in relation to each other.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Polygons
Polygons are shapes defined by vertices that
create three, four or n-sided shape.
Polygon shapes are made up of many
polygons.
Example polygon primitives include: cube,
sphere, cylinder, cone, plane
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
NURBS
NURBS (Non-uniform rational b-spline)
NURBS geometry is spline-based. The
geometry is derived from curves and surfaces
approximated from the surface’s control
vertices (points locations.
NURBS allow you to start with curves that are
then used to generate surfaces.
Example NURBS primitives include: cube,
sphere, cylinder, cone, plane.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
NURBS Curve
Control vertex
Start of curve
end of curve
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Subdivision surfaces
Have characteristics of both NURBS and
Polygon primitives.
Mostly built using a polygon mesh as a base
and then refined.
Advantage of using this geometry type is that
detail is added only where needed, and it
creates smooth surfaces like NURBS.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Modeling : Summary
Definition of modeling
Geometric elements (points, curves, surfaces)
Definitions & Geometric primitives in:
– NURBS
– Polygons
– Sub-division Surfaces
Modeling Practice
– MAYA PLE
– Blender
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Texture Mapping
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Why do we need texture mapping?
Increase realism
objects have spatially
varying details
represent as geometry:
correct, but very
expensive
use simple geometry
store varying properties
in images
– map a brick wall texture
on a flat polygon
– create bumpy effect on
surface.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Why do we need texture mapping?
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Why do we need texture mapping?
Produces compelling results
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Mapping Functions - Projections
maps 3d surface points
to 2d image coordinates
different types of
projections
– often corresponding to
simple shapes
– useful for simple object
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Projection - Planar
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Projection - Cubicle
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Projection to Cylindrical
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Projection - Spherical
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Lighting
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Lighting
Remember, we know how to rasterize
Given a 3-D triangle and a 3-D viewpoint, we know
which pixels represent the triangle
But what color should those pixels be?
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Lighting
If we’re attempting to create a realistic image,
we need to simulate the lighting of the surfaces
in the scene
– Fundamentally simulation of physics and optics
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Definitions
Illumination: the transport of energy from light
sources to surfaces & points
– Note: includes direct and indirect illumination
Images by Henrik Wann Jensen
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Definitions
Lighting: the process of computing the
luminous intensity (i.e., outgoing light) at a
particular 3-D point, usually on a surface
Shading: the process of assigning colors to
pixels
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Definitions
Illumination models fall into two categories:
– Empirical: simple formulations that approximate
observed phenomenon
– Physically based: models based on the actual
physics of light interacting with matter
We mostly use empirical models in
interactive graphics for simplicity
Increasingly, realistic graphics are using
physically based models
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Components of Illumination
Two components of illumination: light
sources and surface properties
Light sources (or emitters)
– Spectrum of emittance (i.e., color of the light)
– Geometric attributes
• Position
• Direction
• Shape
– Directional attenuation
– Polarization
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Components of Illumination
Surface properties
– Reflectance spectrum
(i.e., color of the
surface)
– Subsurface
reflectance
– Geometric attributes
• Position
• Orientation
• Micro-structure
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Simplify – in Interactive CG
– Only direct illumination from emitters to
surfaces
– Simplify geometry of emitters to trivial cases
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Ambient Light Sources
Objects not directly lit are typically still
visible
– e.g., the ceiling in this room, undersides of desks
This is the result of indirect illumination from
emitters, bouncing off intermediate surfaces
Too expensive to calculate (in real time), so
we use a hack called an ambient light source
– No spatial or directional characteristics; illuminates all
surfaces equally
– Amount reflected depends on surface properties
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Ambient Light Sources
For each sampled wavelength (R, G, B), the
ambient light reflected from a surface
depends on
– The surface properties, kambient
– The intensity, Iambient, of the ambient light source
(constant for all points on all surfaces )
Ireflected = kambient Iambient
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Ambient Light Sources
A scene lit only with an ambient light source:
Light Position
Not Important
Viewer Position
Not Important
Surface Angle
Not Important
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Directional Light Sources
For a directional light source we make simplifying
assumptions
– Direction is constant for all surfaces in the scene
– All rays of light from the source are parallel
• As if the source were infinitely far away
from the surfaces in the scene
• A good approximation to sunlight
The direction from a surface to the light source is
important in lighting the surface
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Directional Light Sources
The same scene lit with a directional and an
ambient light source
Light Position
Not Important
Surface Angle
Important
Viewer Position
Not Important
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Point Light Sources
A point light source emits light equally in all
directions from a single point
The direction to the light from a point on a
surface thus differs for different points:
– So we need to calculate a
normalized vector to the light l
source for every point we light:
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Point Light Sources
Using an ambient and a point light source:
Light Position
Important
Viewer Position
Important
Surface Angle
Important
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Other Light Sources
Spotlights are point
sources whose
intensity falls off
directionally.
– Requires color, point
direction, falloff
parameters
– Supported by OpenGL
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Other Light Sources
Area light sources define a 2-D emissive
surface (usually a disc or polygon)
– Good example: fluorescent light panels
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.
Read About
Lighting Models
– Ambient
– Lambert/Diffuse
– Phong/Specular
MB Siggraph 04. Additional slides composed from paper by Hodgins et al, computer animations – GIT.