Assignment 1: One-Ring Smoothing
Due on February 7 (Saturday) at 11:59 PM
Overview
In this assignment you will implement a simple smoothing algorithm in which, at each time-step, a vertex's position is replaced by the average positions of the vertices in its one-ring neighborhood.
- The code skeleton can be downloaded here.
- Example models you can use for testing can be found here.
- A detailed description of the assignment can be found here.
Getting Started
You should use the code (GeometryProcessing.zip) as a starting point for your assignment.
We provide you with numerous files, but you should only have to change
OneRingSmoothing/OneRingSmoothing.cpp.
After you download the files, the first thing to do is compile the OneRingSmoothing executable.
- On a Windows Machine
Begin by double-clicking on GeometryProcessing.sln to open the workspace in Microsoft Visual Studios.
- Compile the
OneRingSmoothing executable by clicking on "Build" and then selecting "Build Solution". Please be sure that you are compiling for Release under x64 mode, as only those project settings were set. (If you need to compile under Debug, you will need to copy over the settings.)
- The executable
OneRingSmoothing.exe is compiled in Release mode for the 64-bit architecture and will be placed in the directory Bin/x64.
- On a Unix/Mac Machine
- Type
make to compile the OneRingSmoothing executable.
- The executable
OneRingSmoothing is compiled in Release mode and will be placed in the directory Bin/Linux.
How to Invoke the Executable
The executable runs on the command line. It takes a geometry file as input, either in ply or in obj file format (determined by the file extension) and opens up an OpenGL-based viewer visualizing progressive smoothing of either a signal defined at the vertices or the geometry itself.
To see the supported command line arguments, run the executable without an argyments:
% OneRingSmoothing
To smooth the geometry itself, invoke the executable as:
% OneRingSmoothing --in <input geometry> --geometry
To smooth a signal defined over the geometry, invoke the executable as:
% OneRingSmoothing --in <input geometry>
In the latter case, one of two things will happen:
- If the geometry containts a per-vertex signal, the visualization will smooth that signal.
- If the geometry does not contain a per-vertex signal, the visualization will smooth a manually prescribed signal, defined by having the user place down positive sources and negative sinks at different vertices.
How to Interact with the Executable
Upon invocation, the executable will open an OpenGL window where the smoothing will be animated.
The basic supported interfaces are:
[space] pauses/resumes the animation
[left mouse] rotates
[right mouse] zooms
[left mouse]+[ctrl] pans
In addition, when smoothing a manually prescribed signal, the following interfaces are supported:
- '
s' enters/exits selection mode
[left mouse] (hold, in selection mode) adds a source
[right mouse] (hold, in selection mode) adds a sink
What You Have to Do
You will need to mofiy the OneRingSmoothing/OneRingSmoothing.cpp file to support both signal and position smoothing.
Stubs for both can be found in the OneRingSmoothingViewer::animate member function.
- The
true branch of the if( _smoothSignal) statement is responsible for smoothing vertex values, stored in the Mesh::values member data.
- The
false branch of the if( _smoothSignal) statement is responsible for smoothing vertex positions, stored in the Mesh::vertices member data.
Please see the assignment description for additional details.
Question
- How does the smoothing of the isotropic bunny model,
Bunny.iso.ply, compare to the smoothing of the anisotropic bunny model, Bunny.ansio.ply?
What to Submit
Please submit your implementation on canvas.
For this assignment, you should submit:
- Your modified
OneRingSmoothing/OneRingSmoothing.cpp file.
- A write up describing what you have implemented. (Particularly, if things did not work as expected, please provide guidance that would allow us to give you partial credit.)