Finding Triangle Strips Ajit Hakke Patil Outline n


















- Slides: 18

Finding Triangle Strips Ajit Hakke Patil

Outline n n n n Graphics Subsystem and visualizing surfaces Triangle lists vs Triangle Strips Problem Definition for finding Triangle Strips NP-Proof NP-Completeness Proof Conclusion References

Graphics Subsystem n n The graphics subsystem (GS) receives graphics commands from the application running on CPU over a bus, builds the image specified by the commands, and outputs the resulting image to display hardware Graphics Libraries: n Open. GL, Direct. X.

Surface Visualization n n As Triangle Mesh Generated by triangulating the geometry

Triangle List vs Triangle Strip n n n Triangle List: Arbitrary ordering of triangles. Triangle Strip: A triangle strip is a sequential ordering of triangles. i. e consecutive triangles share an edge In case of triangle lists we draw each triangle separately. So for drawing N triangles you need to call/send 3 N vertex drawing commands/data. However, using a Triangle Strip reduces this requirement from 3 N to N + 2

Triangle List vs Triangle Strip n n four separate triangles: ABC, CBD, CDE, and EDF But if we know that it is a triangle strip or if we rearrange the triangles such that it becomes a triangle strip, then we can store it as a sequence of vertices ABCDEF This sequence would be decoded as a set of triangles ABC, BCD, CDE and DEF Storage requirement: n 3 N => N + 2

Triangle List vs Triangle Strip // Draw Triangle Strip gl. Begin(GL_TRIANGLE_STRIP); For each Vertex { gl. Vertex 3 f(x, y, z); //vertex } gl. End(); // Draw Triangle List gl. Begin(GL_TRIANGLES); For each Triangle { gl. Vertex 3 f(x 1, y 1, z 1); // vertex 1 gl. Vertex 3 f(x 2, y 2, z 2); // vertex 2 gl. Vertex 3 f(x 3, y 3, z 3); // vertex 3 } gl. End();

Problem Definition n n Given a triangulation T = {t 1, t 2, t 3 , . . tn}. Find the triangle strip (sequential ordering) for it? Converting this to a decision problem. Formal Definition: Given a triangulation T = {t 1, t 2, t 3 , . . t. N}. Does there exists a triangle strip?

NP Proof n n n Provided a witness of a ‘Yes’ instance of the problem. we can verify it in polynomial time by checking if the sequential triangles are connected. Cost of checking if the consecutive triangles are connected n For i to N -1 n Check of ith and i+1 th triangle are adjacent (have a common edge) n Three edge comparisions or six vertex comparisions n ~ 6 N Hence it is in NP.

Dual Graph n n n The dual graph of a triangulation is obtained by defining a vertex for each triangle and drawing an edge between two vertices if there corresponding triangles share an edge This gives the triangulations edge-adjacency in terms of a graph Cost of building a Dual Graph n n O(N 2) e. g G’ is a dual graph of G.

NP-Completeness n n To prove its NP-Complete we reduce to a known NPComplete problem; the Hamiltonian Path Problem: n Given: A Graph G = (V, E). And two distinct vertices u, v V, Does G contains a path that visits every vertex exactly once?

NP-Completeness proof by restriction n n Accept an Instance of Hamiltonian Path, G = (V, E), we restrict this graph to have max. degree = 3. Construct an Instance of Has. Triangle. Strip n Let this be the dual graph G’ = (V’, E’) of the triangulation T = {t 1, t 2, t 3 , . . t. N}. n V’ ~ Vertex vi represents triangle ti, i = 1 to N n E’ ~ An edge represents that two triangles are edgeadjacent (share an edge) Return Has. Triangle. Strip(T) n n G’ <= G n V’ <= V’ n E’ <= E’

NP-Completeness n n n G’ will have a Hamiltonian path iff T has triangle strip of length N – 1. T will have a triangle strip of length N – 1 iff G’ has Hamiltonian Path. ‘Yes’ instance maps to ‘Yes’ instance

NP-Completeness n n n G’ will not have a Hamiltonian path, if T does not have triangle strip of length N – 1. T will not have a triangle strip of length N – 1 if G’ does not have Hamiltonian Path. ‘No’ instance maps to ‘No’ instance

HP =>P Has. Triangle. Strip n n n The ‘Yes/No’ instance maps to ‘Yes/No’ instance respectively and the transformation runs in polynomial time. Polynomial Transformation Hence finding Triangle Strip in a given triangulation is a NP-Complete Problem

Conclusion n n So finding triangle strip in a given triangulation is NPcomplete But also knowing that finding triangle strips is equivalent to finding hamiltonian path has given direction to research in triangulation. So lot of research has been done to come up with triangulation algorithm’s which generate hamiltonian triangulation by adding/deleting points to the existing triangulation Hamiltonian Triangulation: A triangulation whose dual graph has a hamiltonian cycle.

References n n n Garey, M. R. and Johnson, D. S. Computers and Intractability: A Guide to the Theory of NPCompleteness. David Eppstein. The traveling salesman problem for cubic graphs. 2007 M. Gopi, David Eppstein. Single-Strip Triangulation of Manifolds with Arbitrary Topology, 2004 E. Arkin, M. Held, J. Mitchell, and S. Skiena. Hamiltonian triangulations for fast rendering, 1994. Francine Evans. Steven Skiena. Amitabh Varshney Optimizing Triangle Strips for Fast Rendering. 1996.

Questions?