2D outline algorithm for projected 3D mesh

ralphtheninja picture ralphtheninja · Jun 18, 2009 · Viewed 12.2k times · Source

Given: A 3D mesh defined with a set of vertices and triangles building up the mesh with these points.

Problem: Find the 2d outline of the projected arbitrarily rotated mesh on an arbitrary plane.

The projection is easy. The challenge lies in finding the "hull" of the projected triangle edges in the plane. I need some help with input/pointers on researching this algorithm. For simplicity, we can assume the 3D edges are projected straight down onto the xy plane.

Answer

Svante picture Svante · Jun 19, 2009
  • Start with the rightmost point (the point with the biggest x coordinate)
  • Get all edges from this point
  • Follow the edge with the smallest angle to the positive x-axis, and also add it to the solution set
  • From the point reached, follow and add the edge with the smallest angle to the edge you came from
  • Repeat until you reach the original point