By Katie Davis
CSC 572- Spring 2015
My final project for grad graphics was implementing suggestive contours. My program displays the contours on a specified obj file and pressing 'c' toggles on suggestive contours. The user can move the camera to view different sides of the mesh. Shift + click and drag translates the camera, while control zooms and command rotates.
Contours and suggestive contours are non-photorealistic rendering techniques. Contours, otherwise known as silhouettes are essentially the outline of a model. Mathematically, you need the normal vector at a point (n) and the view vector (v) from the camera position to point. When the dot product of n and v are 0, you are on the edge of the shape as seen from the current view, so this is a contour.
Suggestive contours are "almost" contours. They are point that would be a contour if the view was shifted slightly. Specifically, suggestive contours occur where the radial curvature (Kr) at a point is zero and the derivative of Kr in the direction of the tangent plane is positive. The derivation being positive means that the surface is bending away from the viewer.
I found a ton of papers and resources online that talked about the math of what is a suggestive contours. The main paper I used was "Suggestive Contours for Conveying Shape" by DeCarlo et. al. However, I had a difficult time finding resources that had actual implementation details. I had a hard time finding the math behind how to calculate the radial curvature of a point and its derivative. I list all of my sources below in the references section, of particular use was Jeroen Baert's thesis blog. I used trimesh, a princeton mesh library to help compute curvature of meshes. Suggestive contours can be implemented so that the algorithm occurs on the CPU or the GPU, I choose to implement using the GPU.
Contours shown on the left, suggestive contours added on the right.
I spent countless hours trying to find an non-existent bug in my code. What I thought was a bug in my code was really a bad .obj file. Images from some of my bugs are shown below.
One of my original ideas was to try getting suggestive contours on terrain data. I downloaded digital elevation model data in 2D format. I used a program called Photoscuplt (available only for PCs) to turn this data into an .obj file. I then put this .obj file into my program with limited results. Due to time constraints, I was unable to figure out why this file did not render nicely.
CPE 471 and CPE 476- Base code
Jeroen Baert's thesis
Jeroen Baert's github
Suggestive Contours for Conveying Shape
Old CSC 572 student project
Dan Maljovec's Suggestive Contours Project Page