Professional Documents
Culture Documents
Hierarchical
Graphics,
Modeling,
And Animation
Chapter 9 - 2 Interactive Computer Graphics
Overview
Modeling
Animation
Data structures
for interactive
graphics
CSG-tree
BSP-tree
Quadtrees and Octrees
Visibility precomputation
Many figures and examples in this set of lectures are
from The Art of 3D Computer Animation and
Imaging, by I. Kerlow
Chapter 9 - 3 Interactive Computer Graphics
Modeling
The modeling problem
Modeling primitives
Polygon
Sphere, ellipsoid, torus, superquadric
NURBS, surfaces of revolutions, smoothed polygons
Particles
Skin & bones
Approaches to modeling complex shapes
Tools such as extrude, revolve, loft, split, stitch, blend
Constructive solid geometry (CSG)
Hierarchy; kinematic joints
Inverse kinematics
Keyframes
Chapter 9 - 4 Interactive Computer Graphics
Representing objects
Objects represented as symbols
Defined in model coordinates; transformed
into world coordinates (M = TRS)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glTranslatef(…);
glRotatef(…); glScalef(…);
glutSolidCylinder(…);
Chapter 9 - 5 Interactive Computer Graphics
Primitives
The basic sort of
primitive is the
polygon
Number of
polygons:
tradeoff between
render time and
model accuracy
Chapter 9 - 6 Interactive Computer Graphics
Chapter 9 - 7 Interactive Computer Graphics
Spline
Curves
Linear spline
Cardinal spline
B-spline
Bezier curve
NURBS (non-
uniform rational
b-spline)
Chapter 9 - 8 Interactive Computer Graphics
Mesh
Chapter 9 - 9 Interactive Computer Graphics
Mesh deformations
Chapter 9 - 10 Interactive Computer Graphics
Sweep
Sweep a shape over a path to form a
generalized cylinder
Chapter 9 - 11 Interactive Computer Graphics
Revolution
Revolve a shape around an axis to create an
object with rotational symmetry
Chapter 9 - 12 Interactive Computer Graphics
Extrusion
Extrude: grow a 2D shape
in the third dimension
Shape is created with a (1D)
b-spline curves
Hole was created by
subtracting a cylinder
Chapter 9 - 13 Interactive Computer Graphics
Chapter 9 - 14 Interactive Computer Graphics
Joining Primitives
Stitching, blending
Chapter 9 - 15 Interactive Computer Graphics
Modifying Primitives
Chapter 9 - 16 Interactive Computer Graphics
Subdivision Surfaces
Can set level of polygon subdivision
Chapter 9 - 17 Interactive Computer Graphics
Chapter 9 - 18 Interactive Computer Graphics
Chapter 9 - 19 Interactive Computer Graphics
Chapter 9 - 20 Interactive Computer Graphics
Particles
Chapter 9 - 23 Interactive Computer Graphics
Algorithmic
Primitives
Algorithms for
trees, mountains,
grass, fur,
lightning, fire, …
Chapter 9 - 24 Interactive Computer Graphics
Chapter 9 - 25 Interactive Computer Graphics
Hierarchical models
When animation is desired, objects may have
parts that move with respect to each other
Object represented as hierarchy
Often there are joints with motion constraints
E.g. represent wheels of car as sub-objects with
rotational motion (car moves 2 pi r per rotation)
Chapter 9 - 27 Interactive Computer Graphics
Chapter 9 - 28 Interactive Computer Graphics
DAG models
Could use tree to
represent object
Actually, a DAG
(directed acyclic
graph) is better:
can re-use objects
Note that each arrow needs a
separate modeling transform
In object-oriented graphics, also
need motion constraints with each
arrow
Chapter 9 - 29 Interactive Computer Graphics
Example: Robot
Traverse DAG using DFS (or BFS)
Push and pop matrices along the way
(e.g. left-child right-sibling)
(joint position parameters?)
Chapter 9 - 30 Interactive Computer Graphics
Chapter 9 - 31 Interactive Computer Graphics
Modeling Programs
Moray
Shareware
Limited functionality
Easy
Lightwave, Maya
NOT shareware
Very full-featured
Difficult to learn and use
Moray, Maya demos; Lightwave video
Chapter 9 - 32 Interactive Computer Graphics
Animation
Suppose you want
the robot to
pick up a can of oil
to drink. How?
You could set the
joint positions at
each moment in
the animation
(kinematics)
Chapter 9 - 33 Interactive Computer Graphics
Inverse Kinematics
You can’t just invert the
joint transformations
Joint settings aren’t even
necessarily unique for a
hand position!
Inverse kinematics:
figure out from the hand
position where the joints
should be set.
Chapter 9 - 34 Interactive Computer Graphics
Keyframe Animation
In traditional key frame animation the animator
draws several important frames, and helpers do the
“inbetweening” or “tweening”
Computer animation is also key-frame based
At key frames, animator positions objects and lights,
sets parameters, etc.
The system interpolates parameter values linearly or
along a curve
To get from one object pose to the next, inverse
kinematics determine joint motions
[Keyframe animation demo]
Chapter 9 - 36 Interactive Computer Graphics
Motion Capture
More realistic
motion sequences
can be generated
by Motion Capture
Attach joint
position indicators
to real actors
Record live action
Chapter 9 - 37 Interactive Computer Graphics
Chapter 9 - 38 Interactive Computer Graphics
Morphing
Morphing: smoothly shifting from one image
to another
First popularized in a Michael Jackson video
Method: a combination of
Warping both images, gradually moving control
points from location in first image to location in
the second
Cross-fading from first image sequence to second
Chapter 9 - 39 Interactive Computer Graphics
3D Morphing
Define 3D before and
after shapes as e.g.
NURBS surfaces with
same number of
control points
Gradually move
control points from
first setting to second
Specify key poses: e.g.
smile, frown, 12 frames of walking motion
Chapter 9 - 40 Interactive Computer Graphics
Combined approaches
Chapter 9 - 41 Interactive Computer Graphics
Character Animation
To make computer graphics
(or cartoon drawings)
come alive…
Chapter 9 - 43 Interactive Computer Graphics
Object-oriented Graphics
Higher in the programming hierarchy: control
models with object-oriented programs
robot robbie;
robbie.smile();
robbie.walk(270, 5, 3);
Chapter 9 - 46 Interactive Computer Graphics
CSG Tree
Chapter 9 - 48 Interactive Computer Graphics
Application 2: HSR
How to render in 3D with hidden surface
removal when you don’t have a hardware
depth-buffer?
Can you think of any other ways of removing
hidden surfaces quickly?
BSP-tree
The painter’s algorithm for hidden surface
removal works by drawing all faces, from
back to front
How to get a listing of the faces in back-to-
front order?
Put them into a binary tree and traverse the
tree (but in what order?)
Chapter 9 - 50 Interactive Computer Graphics
BSP-tree Summary
Returns polygons not necessarily in sorted
order, but in an order that is correct for back-
to-front rendering
Widely used when Z-buffer hardware may
not be available (e.g. game engines)
Guarantees back-to-front rendering for alpha
blending
Works well (linear-time traversals) in the
number of split polygons
[And we hope the number of polygons
doesn’t grow too much through splitting]
Chapter 9 - 54 Interactive Computer Graphics
Quadtree
Quadtree: divide space into four quadrants.
Mark as Empty, Full, or Partially full.
Recursively subdivide partially full regions
Saves much time, space over 2D pixel data!
Chapter 9 - 56 Interactive Computer Graphics
Quadtree Structure
Chapter 9 - 57 Interactive Computer Graphics
Octrees
Generalize to cutting up a cube into 8 sub-
cubes, each of which may be E, F, or P (and
subdivided)
Much more efficient
than a 3D array of
cells for 3D
volumetric data
Chapter 9 - 58 Interactive Computer Graphics
Quadtree Algorithms
How would you
render a quadtree shape?
find the intersection of a ray with a quadtree
shape?
Take the union of two quadtrees?
Intersection?
Find the neighbors of a cell?
Chapter 9 - 59 Interactive Computer Graphics
Applications of Octrees
Contour finding in MRI data
3D scanning and rendering
Efficient ray tracing
Intersection, collision testing
Chapter 9 - 60 Interactive Computer Graphics
Research in Visibility
Can we figure out in advance what will be
visible from each viewpoint?
Chapter 9 - 61 Interactive Computer Graphics
Viewer-centered representation
Viewer-centered object representations:
representation not of volume of space filled
but appearance from all viewpoints
Chapter 9 - 62 Interactive Computer Graphics
Events
Events: boundaries in viewpoint space
where faces appear or disappear
Chapter 9 - 64 Interactive Computer Graphics
Aspect Graph
Aspect graph: a graph with a node for every
topologically distinct view of an object, with
edges connecting adjacent views
Chapter 9 - 65 Interactive Computer Graphics
Conservative Visibility
Preprocessing on a Grid
Divide viewing
space into a 3D
(or 2D) grid
Compute a
conservative
display list for
each cell
Chapter 9 - 71 Interactive Computer Graphics
Conservative visibility
algorithm
Initialize a display list for each grid cell
Algorithm: for each object, wall, and cell
If the object is not weakly visible from the cell,
remove from cell’s display list
Perspective
What good did this visibility research do for
the world?
It wasn’t enough for me
I left graphics research and went into digital
libraries
Left University of Pittsburgh and went to Wheaton
College
Chapter 9 - 73 Interactive Computer Graphics
Summary
3D modeling uses advanced primitives and
ways of cutting, joining them
Inverse kinematics determines joint position
from end effector motions
Keyframe animation involves important poses
and inbetweening
3D morphing animates surface control points
3D spatial subdivision trees include CSG-
trees, BSP-trees, Quadtrees, and Octrees
Visibility preprocessing speeds walkthrough