Nonphotorealistic Graphics
By Michael Watts
CSC 570Q
Winter 2005


Abstract
Contours are used in non-photorealistic rendering systems to convey shape through the use of lines. Suggestive contours go a step beyond true contours by showing lines on clearly visible surfaces where they would appear as contours from other nearby viewing angles. By combining suggestive contours with true contours, a more complete image can be rendered.

Process
  1. Read in polygon file and built vertice and triangle data structures.
  2. Searched mesh for flipped triangles (triangles with a normal opposite surrounding neighbors).
  3. Calculated edge data structure and neighbor map.
  4. Calculated Barycentric area around each vertex for use in finding the Gaussian and Mean curvatures.
  5. Calculated Gaussian curvature for each vertex based on algorithm described in Meyer, et al.
  6. Rendered mesh with lighting and flat shading enabled.
  7. Rendered contours based on position of camera eye.
  8. Filtered contours based on visibility by rendering the mesh in the same color as the background.
  9. Experimented with toon shading by using the dot product of each triangle normal and view vector as an index into a array of colors.
  10. Displayed Gaussian curves by calculating the zero-crossing at each edge.
  11. Filtered Gaussian curves, only displaying curves where directional derivative of Guassian Curvature in the direction of th view vector > 0. For this I borrowed DeCarlo's vertex gradient implementation.
  12. Calculated Mean curvature vector for each vertex based on algorithm described in Meyer, et al.
  13. Calculated Principle curvature using Gaussian and Mean curvatures (Meyers, et al).
  14. Failed to calculate Principle Directions which would allow calculation of Radial curvature from DeCarlo paper.


Screenshots
Contours without hidden line removal. Contours with hidden line removal.
Contours with toon shading.
Contours and K = 0 (Gaussian Curvature). Gaussian curves filtered where directional derivative of K in the direction of the view vector > 0.


Commands
Scale +/-
Rotate Eye Right-mouse
Rotate Mesh Left-mouse
Toggle lighting L
Toggle mesh I
Toggle contours C
Toggle hidden curves B
Toggle toon shading T
Toggle Gaussian curves G
Toggle line filtering F
Reset R
   


Executable
Contours.exe (Win32 executable)

Bunny polygon file: bun_zipper_res3.ply
Dragon polygon file: dragon_vrip_res4.ply

Source for data files: http://www-graphics.stanford.edu/data/3Dscanrep/
(Note: PLY files might need to be converted to UNIX line endings.)


References and Resources