Assignment 4: Interactive Modeling
Due: 11/17/2000, at 11:59PM
Overview
The goal of this assigment is to introduce you to mesh representation,
curve/surface smoothing, and modeling. You will be creating a basic
interactive modeling program for generating smooth surfaces that allows
a user to drag vertices of a coarse control mesh in 3D while displaying
an associated smooth surface. You will be asked to implement aspects of
both the user interface and the subdivision algorithm, and finally use
your program to construct several models.
Specifically, you will write a program that reads a set of triangles
from a .ray file, builds a "control" mesh from these triangles (shown in
green above), and displays it in a window using OpenGL. As the program
executes, a user can subdivide the control mesh (each press of the `S'
key subdivides one level further) to produce a smooth subdivision surface
for display (shown in gray above). The user may also drag vertices
of the control mesh with the mouse while the corresponding finest level
of the subdivision surface is updated continuously in the display.
To create the smooth surface, we will be implementing the Loop subdivision
scheme.
You'll construct the topology of the subdivided meshes only once, and
after that update the geometry of these surfaces using the subdivision
rules. At the highest level, your program will juggle the following
meshes:
-
level 0: course mesh (displayed and the user is allowed to move vertices)
-
level 1: intermediate mesh (not displayed)
-
level 2: intermediate mesh (not displayed)
-
...
-
level n: final fine mesh (displayed)
Much work has been done on the properties and applications of subdivision
surfaces, and below are some references for the curious. Everything
you need to know to implement subdivision should be in the course notes,
however. Here's a little subdivision primer that might be useful
(.ppt).
-
E. Catmull and J. Clark. Recursively generated B-spline surfaces on arbitrary
topological meshes. Computer Aided Design, 10(6):350-355,
1978.
-
Smooth Subdivision Surfaces Based on Triangles, Charles Teorell Loop, Department
of Mathematics, University of Utah, August 1987.
(15mb
pdf,
download - don't view in browser)
-
Siggraph 2000 Course Notes: Subdivision for Modeling and Animation.
(30mb pdf,
download - don't view in browser)
Relevant pages are 47-50, 70.
What You Have to Do
Implement an interactive subdivision surface modeling program, which reads
a model file, subdivides it, displays it, lets you interactively move the
original mesh around while updating the subdivided surface, and outputs
the final course and fine mesh. The inputs to the program will be
a course mesh in the .ray file format (vertices and triangles only).
The output of the program will also be a .ray file.
The assignment is worth 20 points. The following is a list of features
that you may implement. The number in parentheses corresponds to how many
points it is worth. Options in bold are mandatory.
User interface:
-
(1) finer control: Let the user turn the subdivided mesh into the
coarse mesh. (see the examples page)
-
(2) normal dragging: Let the user drag control points of the original
control mesh. Mouse movements should translate into movements in
the normal direction of the surface.
-
(1) orthogonal dragging: Let the user drag control points of the original
control mesh. Mouse movements should translate into movements orthogonal
to the viewing direction.
-
(4) neighborhood dragging: Let the user move a whole neighborhood of control
points around with one mouse stroke. The user should select a single
control point, and its vertex neighborhood should move with the mouse.
The neighbors should move less than the control point selected.
-
(1) detail elision: draw mesh with intermediate detail while it is being
translated, rotated, scaled during interactive viewing.
-
(2) multiple vertex dragging: allow selection of multiple vertices (e.g.,
by clicking with shift down) and move them all with the same dragging motion.
-
(3) creases: allow a method for interactively specifying creases in the
model.
-
(?) Some other user interface enhancement that you can argue is useful
in creating a model.
Mesh subdivision:
-
(9) subdivision: Implement the Loop subdivision algorithm.
Assume the original mesh contains only triangles.
You will need seperate rules for boundary and interior nodes. When
a user moves a vertex, it's ok to recompute the entire subdivision surface
at each level, but you should only compute the topology once.
Verify that your subdivision scheme works on the models in
/u/cs426/4/ray. For the plane,
cylinders, pawn, torus, moebius strip,
and vase, move the control mesh noticably, subdivide it two or three times,
and output the finest resolution mesh as a new .ray file (see the
examples page).
-
(1) rules: change the subdivision rules and show what effect this has on
the fine mesh.
-
(1) smooth shading: Calculate normals at all vertex points and feed this
information into OpenGL when drawing the smooth mesh.
-
(3) finite support: When a vertex moves, only recompute the vertices that
need to be recomputed. This should allow you to move vertices of
large base meshes and still have interactive updates.
-
(2) textures: Instead of just subdividing vertex positions, subdivide texture
coordinates as well. Assume the input file provides texture coordinates
(one texture map for the entire mesh) for each vertex. Display the
subdivided textured mesh.
-
(4+) multiresolution: Let the user move vertices at all levels of the subdivision
hierarchy. At each level, store offsets from the previous level in
a local frame. This is difficult.
Create some models using your program:
-
(2) Original model: Create a new coarse mesh with your program and
subdivide it to produce an interesting object, such as a fish, mountain
terrain, machine part, human, horse, bunny, rabbit, squirrel, or an impression
of a famous roman statue.
-
(?) Impress us with something beautiful...
You should try to create the course model yourself, using whatever tools
you want. For each of model, you need to submit a coarse mesh that,
when subdivided without modification, results in your final model.
By implementing all the required features, you get 14 points. There
are several ways to get more points:
-
implement optional features (as listed above),
-
(1) include a one page section in your writeup commenting on your interactive
modeling experience. Here are some ideas: What features would you
need to create a complicated model? Which of these features fit inside
the subdivision framework? How did you create the initial course
mesh? How could you use subdivision for animation? (around
a page, double spaced, size 12 font, 1" margines)
-
(1) submit a picture of a model for the art contest
-
(2) win the art contest
-
(?) implement something original
It is possible to get more than 20 points. However, after 20 points, each
point is divided by 2, and after 22 points, each point is divided by 4.
Getting Started
You should use the code available at /u/cs426/4/, on the MECA
machines, as a starting point for your assignment. You can also get the code
here (.tar, .zip).
The code we give you is able to load a .ray file and display it.
It also sets up basic menus (click the right mouse button) and
several keyboard shortcuts. This is just a starting point for the project,
so feel free to change anything you want, but you will mainly need to modify
the following files:
-
main.cpp: manages meshes and sets up UI framework.
-
Face.[cpp/h]: Face class.
-
Mesh.[cpp/h]: Mesh class, containing Vertices and Faces.
-
Vertex.[cpp/h]: Vertex class.
There are several support classes which you shouldn't need to touch:
-
ArcBall.[cpp/h]: Arcball rotation user interface.
-
Quaternion.[cpp/h]: Quaternion support class. Quaternions are used
for rotions in the arcball user interface.
-
Color.[cpp/h]: Color support class.
-
Vector.[h]: 3D vector support class.
-
Misc.h: Basic routines.
What to Submit
You should submit
one archive (zip or tar file) containing:
-
the complete source code with a Visual C project file
-
any base meshes you used, and everything you had to create models
-
a writeup
The writeup should be a HTML document called assignment4.html
which may include other documents or pictures. It should be brief, describing
what you have implemented, and how you created your models.
Make sure the code compiles in the MECA
workstations under Visual C++ (unlike previous assignments, we are requiring
compiling under Visual C++). If it doesn't, your grade will suffer.
If submit doesn't work email your assignment. Always remember
the late
policy and the collaboration
policy.
Last update: 11/10/99
10:17 AM