COS 426:
Computer Graphics
Spring 2014


General | Syllabus | Assignments | Final Project


Overview

In this assignment you will create a simple mesh processing program. The operations that you implement will mostly be filters that take an input mesh, process the mesh, and produce an output mesh.


Running the Program

The mesh processing program, meshpro, runs on the command line. It reads a mesh from a file (the first program argument) and writes a mesh to a file (the second program argument). In between, it processes the mesh using the filters specified by subsequent command line arguments. For example, to scale a mesh in.off by a factor of 1.1, and save the result in the mesh out.off, you would type:

% meshpro in.off out.off -scale 1.1 1.1 1.1
For each available mesh filter there may be one or more parameters -- e.g., -scale takes three factors (sx sy sz). To see the complete list of filters and their parameters, type:
% meshpro -help
If you specify more than one filter on the command line, they are applied in the order that they are found. For example,
% meshpro in.off out.off -scale 0.8 0.8 0.8 -rotate 0.5 0 0 0 0 0 1
would first scale the mesh by 0.8 in all three dimensions and then rotate the mesh by 0.5 radians around a line through the point (0,0,0) and with direction vector (0,0,1) -- i.e., the z-axis. Of course, you are welcome to create your own filters and add program arguments for them by editing meshpro.cpp. However, please do not change the program arguments for the filters already provided.


Implementing the Mesh Processing Operations

The assignment is worth 20 points. The following is a list of features that you may implement (listed roughly from easiest to hardest). The number in front of the feature corresponds to how many points the feature is worth. The features in bold face are required. The other ones are optional. Refer to the examples web page to see images of inputs and outputs for several of these filters.

By implementing all the required features, you get 14 points. There are many ways to get more points:

It is possible to get more than 20 points for this assignment. Your final score will be calculated by adding your score on the required features (up to 14 points) and your bonus for winning the art contest (up to 2 points) to your score on the non-required features, where the value of non-required features incurs diminishing returns after the first 6 points: each successive point beyond 6 is worth 2/3 as much as the previous one. For example, if you get 12 of the 14 points for required features listed in bold and correctly implement optional features worth 10 more points, then your score is 19.1 (12 + 6 + 2/3 + (2/3)^2).



Getting Started

You should download the starter code from (cos426_assignment2.zip) as a starting point for the assignment. The zip file contains the correct directory structure for submissions, helpful source code, and a template writeup html file (see cos426_assignment2/README.txt in the zip file for details).

Compiling the code produces two executables: meshpro and meshview (or meshpro.exe and meshview.exe). meshpro is the program that processes mesh (just like imgpro from assignment #1), and meshview provides a way for you to visualize and process meshes interactively.

To implement the image processing features listed above, you should add code to the appropriate functions within src/R3Mesh.cpp, add commands to the Makefile to test them, and add sections to the writeup.html to present and discuss your results.

The starter code contains a skeleton class for representing and processing meshes (in R3Mesh.h and R3Mesh.cpp). It is able to read meshes in two simple mesh file formats: the RAY File Format (.ray) and the Object File Format (.off), the latter of which is commonly used for interchange between mesh processing programs. We provide several meshes that you can use to test your program in the "input/" directory of the zip file and at this web page sample meshes. However, you are not limited to these files -- you can find other .off files on the web.

The starter code also contains useful classes for manipulating 3D points, vectors, line segments, rays, lines, planes, boxes, and matrices in the R3 subdirectory, as well as the R2Image and R2 functions provided with Assignment 1.



Submitting

You should submit your solution using one zip file named cos426_assignment2.zip via CS dropbox at this submission link. The submitted zip file should have the following internal directory structure:

cos426_assignment2/

The writeup.html file should be an HTML document demonstrating the effects of the features you have implemented and would like scored. For some features (e.g., curvature), you can simply show the input and output of your program. However, for features that take an input parameter (e.g., inflate), you should provide a series of images showing at least three settings of the input parameter to demonstrate that your code is working properly. You can start from the writeup.html provided with the distribution as a template -- simply add sections to that HTML file for the features you implement in the following format:

The src directory should have all code required to compile and link your program (including the files provided with the assignment), along with a Visual Studio Solution file and a Makefile to rebuild the code. We will not attempt to grade assignments that neither build in Visual Studio nor with GNU Make under Mac OS X.

The Makefile should be a script containing the commands that generate all the meshes in the output directory that demonstrate features of your program you would like scored. It should run without crashing when started in the cos426_assignment2/ directory (i.e., it should be possible to delete all the mesh files in the output directory and then run make to regenerate them).

We will test your code on Linux by running make in your src/ subdirectory, followed by make in the main assignment directory to create the output images. Please ensure that your code builds/runs in this way before submitting. Your Makefile should generate all the images in the output directory referenced by your writeup.

To save space, please submit images in .jpeg format (not .bmp or .ppm) and remove binaries and backup files from the src directory before submitting -- i.e., run make clean (under Linux or Mac OS) and execute "Clean Solution" on the "Build menu" in MS Visual Studio.

Note that you are expected to use good programming style at all times, including meaningful variable names, a comment or three describing what the code is doing, etc. Partial credit may not be assigned for code without comments.



FAQ

Answers to frequently asked questions: