Transcript Silhouette
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 reference point (camera or point light) 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) Topological Traversal evertex svertex Supposed this edge has been detected as silhouette CGTopics (S10) Triangular mesh; all faces CCW-winded 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 svertex is evertex This should be more doable in OpenMesh Example1 CGTopics (S10) Example2 CGTopics (S10) Example3 CGTopics (S10) Example4 CGTopics (S10) Example5 CGTopics (S10) Example6 CGTopics (S10) Might have problems if we only trace edges Should trace contours on a model CGTopics (S10) 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 e v CGTopics (S10) 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 Face::IsFrontFacing(refpos) refpos CGTopics (S10) True if dot(normal, refpos – anypos) > 0 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)