Triangulation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Computer Graphic (Triangulation)

"Work Point of the Day"


(Simple idea about graphic design steps)

(a) (b) (c)

The step of triangulation in the graphics pipeline typically occurs after the modeling and before the
rendering stage. It's part of the geometry processing phase
Historical background on triangulation in
computer graphics

• The use of triangulation in computer


graphics can be traced back to the early
days of 3D graphics and rendering. Edwin Catmull
• One of the early pioneers in this field
was Ed Catmull, who used triangulation
techniques in his work. While it's
challenging to pinpoint the very first
instance of triangulation in computer
graphics.

https://www.youtube.com/watch?v=naGntYNTSQM
What is Triangulation?
• Triangulation in computer graphics is a fundamental
technique used to represent complex shapes or surfaces by
dividing them into simpler components, typically triangles.
• This process involves breaking down a polygonal or irregular
geometric structure into a network of interconnected
triangles, which makes it easier for computers to render and
manipulate the object.
• Triangulation serves as the basis for various operations in
computer graphics, such as 3D modeling, rendering, and
mesh generation, allowing for efficient processing and
realistic visual simulations in the world of digital design and
animation.
Applications in Computer Vision
• Depth Estimation: Triangulation helps compute
depth from multiple camera views by finding
points of correspondence.

• 3D Reconstruction Meshing/Remeshing): Uses


triangulated points from 2D images to create 3D
models, essential in robotics, AR, and VR.
Why ?
1. Simplicity in Mathematics: Triangles are simple shapes easily understood by computers. Calculating point
locations and triangle details is easier than dealing with more complex shapes like squares or other polygons.

2. Performance Improvement: Dividing shapes into triangles reduces the number of points and details that the
computer has to process, thus enhancing drawing and rendering performance.

3. Data Homogeneity: Using triangles as the basic unit for division creates data homogeneity, making it easier to
represent various shapes using the same data structure.

4. Shading Techniques: Applying shading and lighting effects to triangles is more efficient and straightforward
compared to complex shapes like squares or irregular polygons.

Although other shapes like squares are used in certain applications as needed, triangles remain the most common
and effective choice in the field of computer graphics.
Why ?

Why Triangulation Works Well in Computer Graphics


•Computational Efficiency: Triangles are the simplest polygon, defined by just
three points, making them computationally efficient to process and render.

•Flexibility: Triangles can approximate any shape, making them versatile for
complex surfaces.

•Stability: Triangles are always planar, so they don’t suffer from distortions that
can occur with polygons of more than three vertices
"How is triangulation done?"
• Although every set of vertices can be triangulated, not all
triangulations are equivalent.
Methods of Triangulation
1.Ear Clipping Triangulation .

2. Delaunay Triangulation.

3. Irregular Network Triangulation.

4.Voronoi-based triangulation

5. Constrained Delaunay Triangulation.


1. Ear Clipping Triangulation:
•Definition: Ear Clipping is a simple algorithm used to triangulate a simple
polygon (a polygon without self-intersections) by removing "ears.“

•Concept: An ear is a triangle formed by three consecutive vertices (A, B, C)


where:
•The triangle (ABC) lies entirely inside the polygon.
•No other vertex of the polygon is inside the triangle.

•Steps:
1.Identify an "ear" (a triangle with no other points inside).
2.Clip the ear by creating a triangle and removing the middle vertex.
3.Repeat until only triangles remain.
Methods of Triangulation
1. Ear Clipping Triangulation:
is a method used to triangulate a simple polygon. It involves identifying "ears" in the polygon, which are convex
vertices with their diagonals fully contained within the polygon. The process consists of iteratively removing
these ears by connecting them with diagonals, ultimately breaking down the polygon into non-overlapping
triangles. Ear triangulation is commonly used for 2D shape decomposition and mesh generation.
Algorithm : while n > 3 do (no. Of vertex)
a) Locate an ear tip v2
b) Output the triangle v1, v2, v3
c) delete v2

a b

The right polygon shows the ear(2,4,5)

(Figure 1.a: Ear Clipping Process)


c

d e

(Figure 1.b: Ear Clipping Process)


f

g (Figure 1.c: Ear Clipping Process)


2. Delaunay Triangulation :
is a geometric algorithm used to partition a set
of points in a plane into a set of non-overlapping
triangles in such a way that no point lies within
Methods of the circumcircle of any triangle.
Triangulation This results in a triangulation that maximizes the
minimum angle of all the triangles, which helps in
avoiding long and skinny triangles. Delaunay
triangulation is widely used in various fields,
including computer graphics, mesh generation,
computer vision, and computational geometry.
Delaunay triangulation methods:
-There are several methods to compute Delaunay triangulation, Here are a few
common methods:
1. Incremental Insertion.
. Bowyer-Watson Algorithm.
2. Divide and Conquer​.
3.Flip algorithms.
4.Sweep hull.
5.Lifting algorithm

The choice of the best method depends on the specific application and the number
of points. For small point sets, any of the methods may work effectively. for larger
point sets, algorithms based on incremental insertion or divide and conquer are
often more efficient, so, Let's talk more about the most famous algorithms.
• Once the convex hull has been constructed, all that is required to
obtain the Delaunay triangulation is to project the edges back to their
original d-space.
• This approach, first pointed out by Brown with respect to Voronoi
Diagrams and by Edelsbrunner and Seidel with respect to Delaunay
triangulations, allows us to use any convex hull algorithm to solve the
Delaunay triangulation problem.
Bowyer-Watson Algorithm
• The Bowyer-Watson algorithm is an incremental algorithm for constructing
Delaunay triangulations. Here’s a simplified overview of how it works:
• Start with a super-triangle that encompasses all the points in the set.
• Add each point one at a time:
• For each point, find all the triangles whose circumcircle contains the point (these
triangles are considered to be "bad" because the new point invalidates them).
• Remove these bad triangles, creating a "hole."
• Triangulate the hole formed by connecting the new point to the
boundary of the hole.
• Repeat this process until all points have been added.
• Remove the triangles connected to the vertices of the super-triangle.

• This algorithm is relatively simple and intuitive, especially in its approach to


incrementally building the triangulation and removing triangles that violate the
Delaunay condition.
Delaunay
Triangulation -
Incremental
Insertion
Delaunay
Triangulation -
Incremental
Insertion
Delaunay
Triangulation -
Incremental
Insertion
Delaunay Triangulation -Incremental Insertion
Delaunay Triangulation -Incremental Insertion
Delaunay Triangulation -Incremental Insertion
Delaunay Triangulation -Incremental Insertion
Delaunay Triangulation -Incremental Insertion
• If the determinant is positive, the point is inside the circle.
• If it’s negative, the point is outside of the circle.
• If the determinant is zero, the point also lies on the circle.
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method
Perpendicular bisector method

• Check the distance from other vertices ((P4 ) in this example) to the
circumcentre (2.864,2.044) to decide if the vertex inside the circle or not
Perpendicular bisector method
• Final triangulation
Methods
of Triangulation
• 3. Irregular network triangulation in
computer graphics is the process of
connecting unstructured data points
with triangles to create a mesh or
surface representation for complex
and irregular shapes or surfaces. This
technique is essential for tasks like
terrain modeling and 3D object
reconstruction.
• 4.Polygon triangulation in computer graphics is the process of
Methods of breaking down a complex polygon into a and manipulate the shape. It's a
fundamental technique used in network of interconnected triangles,
making it easier for computers to render various graphic operations, such
Triangulation as 3D modeling, rendering, and mesh generation.
Methods of Triangulation
5-Constrained Delaunay Triangulation: is an extension of the
Delaunay triangulation method, specifically designed to handle
cases where you have predefined constraints or edges that must
be incorporated into the final triangulation. These constraints are
typically provided as input to the algorithm and are maintained in
the resulting triangulation
• In summary, Constrained Delaunay Triangulation is a method
that combines the advantages of Delaunay triangulation with the
ability to include specific constraints, making it a valuable tool in
various applications requiring precise geometric representation
while preserving required edges or features.
The following example, using the simple polygon of figure 1, shows at a high level how the algorithm is
structured. The initial list of convex vertices is C = {0, 1, 3, 4, 6, 9}, the initial list of reflex vertices is R =
{2, 5, 7, 8} and the initial list of ears is E = {3, 4, 6, 9}. The ear at vertex 3 is removed, so the first triangle
in the triangulation is T0 = ⟨2, 3, 4⟩. Figure 2 shows the reduced polygon with the new edge drawn in
blue.

a The adjacent vertex 2 was reflex and still is. The adjacent vertex 4 was an ear and remains so. The
reflex list R remains unchanged, but the ear list is now E = {4, 6, 9} (removed vertex 3). The ear at
vertex 4 is removed. The next triangle in the triangulation is T1 = ⟨2, 4, 5⟩. Figure 3 shows the reduced
polygon with the new edge drawn in blue

b
The adjacent vertex 2 was reflex and still is. The adjacent vertex 5 was reflex but is now convex. It is
tested and found to be an ear. The vertex is removed from the reflex list, R = {2, 7, 8}. It is also added to
the ear list, E = {5, 6, 9} (added vertex 5, removed vertex 4). The ear at vertex 5 is removed. The next
triangle in the triangulation is T2 = ⟨2, 5, 6⟩. Figure 4 shows the reduced polygon with the new edge
drawn in blue
c The adjacent vertex 2 was reflex but is now convex. Although difficult to determine from the figure, the vertex 7 is inside
the triangle ⟨1, 2, 6⟩, so vertex 2 is not an ear. The adjacent vertex 6 was an ear and remains so. The new reflex list is R = {7,
8} (removed vertex 2) and the new ear list is E = {6, 9} (removed vertex 5). The ear at vertex 6 is removed. The next triangle
in the triangulation is T3 = ⟨2, 6, 7⟩. Figure 5 shows the reduced polygon with the new edge drawn in blue
d The adjacent vertex 2 was convex and remains so. It was not an ear, but now it becomes one. The adjacent
vertex 7 was reflex and remains so. The reflect list R does not change, but the new ear list is E = {9, 2} 4
(added vertex 2, removed vertex 6). The ear list is written this way because the new ear is added first
before the old ear is removed. Before removing the old ear, it is still considered to be first in the list. The
remove operation sets the first item to be that next value to the old ear rather than the previous value.
The ear at vertex 9 is removed. The next triangle in the triangulation is T4 = ⟨8, 9, 0⟩. Figure 6 shows the
reduced polygon with the new edge drawn in blue

e The adjacent vertex 8 was reflex but is now convex and in fact an ear. The adjacent vertex 0 was convex and remains
so. It was not an ear but has become one. The new reflex list is R = {7} and the new ear list is E = {0, 2, 8} (added 8,
added 0, removed 9, the order shown is what the program produces). The ear at vertex 0 is removed. The next triangle
in the triangulation is T5 = ⟨8, 0, 1⟩. Figure 7 shows the reduced polygon with the new edge drawn in blue.

f Both adjacent vertices 8 and 1 were convex and remain so. Vertex 8 remains an ear and vertex 1 remains not an ear.
The reflex list remains unchanged. The new ear list is E = {2, 8} (removed vertex 0). Finally, the ear at vertex 2 is
removed. The next triangle in the triangulation is T6 = ⟨1, 2, 7⟩. Figure 8 shows the reduced polygon with the new
edge drawn in blue.

g At this time there is no need to update the reflect or ear lists because we detect that only three vertices remain. The
last triangle in the triangulation is T7 = ⟨7, 8, 1⟩. The full triangulation is show in Figure

You might also like