CS488 - Introduction to Computer Graphics - Lecture 29


Particle Systems

How to use them for visualization.

  1. Example. For visualizing motion in a fluid
    1. Add particles upstream
    2. Let them be carried by the fluid
    3. Until the fluid flows out of the scene.

Fractal Terrain Generation

What is it?

How is it done?

  1. Start with a polygon covering the terrain
  2. Divide each edge in two by positioning a new vertex in its middle.
  3. Add new edges.
  4. Iterate to 2 until it's good enough.


  1. Gets expensive fast. Do as few iterations as possible.
  2. Don't look directly down on it. Why?
  3. h(n) will need extensive tweaking. Don't get discouraged if you don't get the results you want right away.
  4. You could do the first few iterations by hand to control the large-scale result.

What is it good for?

  1. Mountains
  2. Rolling hills
  3. Sand dunes. You will want h(n) to depend on the direction of the edge.
  4. etc.

Polyhedra and Meshes

What is a polyhedron?

  1. A set of vertices
  2. Connected by edges
  3. Which define faces

Ray Tracer format

  1. Array of edges (3 floats)
  2. Array of faces (pointers to vertices, needs to know number of vertices)
  3. Build the arrays as you read the input.


  1. Finding the faces that surround a vertex, or the edges that emanate from a vertex
  2. Modifying the mesh.
    1. Add a vertex and a face, easy.
    2. Add a vertex, split a face, need to find the face.
    3. What's hard is finding the face to delete. ( O(nFaces) )

An improved solution

  1. Build a list of faces for each vertex when reading the input
  2. Can now find faces from vertices. To split a vertex
  3. General deletion is still hard, unless you are willing to tolerate holes in the array.

Winged Edge Data Structure

When we talk about polyhedra & meshes it seems most natural to talk about vertices

And we have been most interested in vertices and faces. Meshes are, of course, graphs

Every time we see a graph we should think,

In the dual edges are primary:

Winged edge data structure

Each edge has

  1. pointers to the faces it separates
  2. pointers to the vertices at its ends
  3. participates in a doubly linked list of edges at each of its ends

Each vertx has

  1. one pointer to an edge
  2. Exercise. Why do you only need one?

Each face has

  1. one pointer to an edge
  2. Exercise. Why do you only need one?

Issues to consider

  1. Traversal. Can you find all neighbours quickly?
  2. Vertex/edge addition. Can you do it in constant time?
  3. Vertex/edge deletion. Can you do it in constant time?

Splines without Tears

Why do splines exist at all?

The French curve.

General piece-wise curves

  1. One example is line segments: you have been making them all along.

When you put them in a mesh there is an extra requirement

Linear curves necessarily give derivative discontinuities (called C1 continuity)

Is it good enough to get me away from the French curve?

Now you have a way of making smooth-enough curves specified by a small number of points.

Why is it important to have them available?

Return to: