Silhouette Matters
CGTopics (S10)
Definition
[Wiki] A silhouette is a view of an object or scene consisting of the outline and a featureless interior, with the silhouetted object usually being black
Silhouette edges: the outline of an object with respect to a
(camera or point light) reference point
CGTopics (S10)
Shadow Volume
– other use of silhouette
Silhouette also used in object-based anti-aliasing (Wiki)
CGTopics (S10)
Silhouette in NPR
CGTopics (S10)
Silhouette Edge Detection
Brute force algorithm
Go through all edges in the model; label edges that have exactly one frontfacing face and one back-facing face
CGTopics (S10)
Silhouette Detection (cont)
Randomized algorithm (Markosian97)
Fact: silhouette edges are often closed
Algorithm: start from a set of randomly selected edges, if any of them belongs to part of silhouette, trace the contour out by topological traversal
CGTopics (S10)
Winged Edge Data Structure vs fright fleft ve
CGTopics (S10)
Triangular mesh; all faces CCW-winded
Topological Traversal evertex svertex
Supposed this edge has been detected as silhouette
FindSilhouetteLoop (sedge)
Set one end of sedge as svertex, the other end as evertex
Check all incident edges of svertex ; one of them (besides sedge) must be also silhouette; set it as the new sedge
Update svertex as
EdgeOtherVertex (sedge,svertex)
Continue iteration until evertex svertex is
This should be more doable in OpenMesh
CGTopics (S10)
Example
1
CGTopics (S10)
Example
2
CGTopics (S10)
Example
3
CGTopics (S10)
Example
4
CGTopics (S10)
Example
5
CGTopics (S10)
Example
6
CGTopics (S10)
Might have problems if we only trace edges
CGTopics (S10)
Should trace contours on a model
The following are obsolete with the use of OpenMesh
CGTopics (S10)
Need these queries …
Vertex* Edge::OtherVertex(Vertex *v);
Edge* Vertex::NextIncidentEdge(Edge* e);
Bool Edge::IsSilhouette();
Edge* Face::PreviousEdge(Edge* e);
Bool Face::IsFrontFacing(cont Vec3 refpos);
Void Face::anyPosition(Vec3& pos);
CGTopics (S10)
Find the next Incident Edge of a Vertex e v
If v is the start_v of e, take fleft of e
Else, take fright of e
The previous edge of the face is the next incident edge e v
CGTopics (S10)
Face::IsFrontFacing(refpos) refpos
True if dot(normal, refpos – anypos) > 0
CGTopics (S10)
Attributes of an Edge int randcode; // for random selection of edges int rand() returns [0, RAND_MAX] m%: say select [0, m*RAND_MAX/100]
May want to use srand(time(NULL) ) to change seed.
int visited; // for topological traversal
If an edge has been traversed, no need to explore again
Remember to reset the flag when the reference point changes
CGTopics (S10)