You are on page 1of 18

Triangle meshes

• Abunchoftrianglesin3Dspacethatareconnectedtogether
toformasurface
• A triangle mesh is a type of polygon mesh in computer graphics.
• It comprises a set of triangles (typically in three dimensions) that are
connected by their common edges or corners.
Triangle strip
• A triangle strip is a series of connected triangles, sharing vertices,
allowing for more efficient memory usage for computer graphics.
• They are more efficient than triangle lists without indexing, but
usually equally fast or slower than indexed triangle lists
• The primary reason to use triangle strips is to reduce the amount of
data needed to create a series of triangles.
Mesh Topology
• the mesh topology—the way the triangles connect together
• The simplest and most restrictive requirement on the topology of a
mesh is for the surface to be a manifold
• a single edge is shared by more than two faces. In other words, in a
manifold mesh, there are at one place more than two faces that meet
at a single edge that is common to those faces
Triangle mesh schemes (simple)
• Separate triangles mesh
• Shared vertex mesh
• Indexed triangle mesh
• ....

5
Separate triangles mesh
• Each triangle is an object that stores the coordinates
of its vertices
 the same coordinates are stored multiple times

v6 T1 (x1,y1,z1) (x5,y5,z5) (x6,y6,z6)


v1 v7
T1 T2 (x1,y1,z1) (x2,y2,z2) (x5,y5,z5)
T5 T6
T2 v5
v2 T7 T3 (x2,y2,z2) (x3,y3,z3) (x5,y5,z5)
T3 T4 v8
v4  
 
 
v3

6
Shared vertex mesh
• Each vertex is an object that stores its coordinates
• Each triangle is an object that stores references to its
vertices
v1 (x1,y1,z1)
v2 (x2,y2,z2)
v6 v3 (x3,y3,z3)
v1 v7

T1 T6 T1 v1 v5 v6 
T5 
T2 v5
v2 T7 T2 v1 v2 v5
T3 T4 v8
v4 T3 v2 v3 v5
v3  
 
  7
Indexed triangle mesh
• Same as shared vertex mesh but the j-th vertex of the
i-th triangle is addressed as Array[ i ][ j ], j = 1,2,3 and
i = 1,2, ..., no. of triangles
v1 (x1,y1,z1)
v2 (x2,y2,z2)
v6
A[1][1] = 1
A[1][2] = 5 v3 (x3,y3,z3)
v1 v7 A[1][3] = 6 
T1 T6 A[2][1] = 1 
T5 
T2 v5 A[2][2] = 2
v2 T7
T3 T4
A[2][3] = 5
v8
v4

v3 

8
Triangle Fans
• A triangle fan is a primitive in 3D computer graphics that saves on
storage and processing time.
• It describes a set of connected triangles that share one central vertex
• If N is the number of triangles in the fan, the number of vertices
describing it is N+2.
• his is a considerable improvement over the 3N vertices
Triangle Strips
• A triangle strip is a series of connected triangles, sharing vertices,
• allowing for more efficient memory usage for computer graphics.
• They are more efficient than triangle lists without indexing
• The primary reason to use triangle strips is to reduce the amount of
data needed to create a series of triangles.
• The number of vertices stored in memory is reduced from 3N to N+2,
where N is the number of triangles to be drawn.
Triangle Strips
• For example, the four triangles in the diagram,
• without using triangle strips, would have to be stored and interpreted
as four separate triangles: ABC, CBD, CDE, and EDF.
• However, using a triangle strip, they can be stored simply as a
sequence of vertices ABCDEF.
Scene Graphs
• A triangle mesh manages a collection of triangles that constitute an
object in a scene,
• but another universal problem in graphics applications is arranging the
objects in the desired positions.
• Most scenes admit to a hierarchical organization, and the
transformations can be managed according to this hierarchy using a
scene graph.
• A scene graph is a general data structure commonly used by vector-
based graphics editing applications and modern computer games,
• It is a collection of nodes in a graph or tree structure.
Scene Graphs

Fig. (a) An example of a model consisting of four connected parts that can move
relative to each other. (b) A scene graph of the object model
Spatial Data Structures
• the ability to quickly locate geometric objects in particular regions of
space is important.
• Ray tracers need to find objects that intersect rays
• interactive applications navigating an environment need to find the
objects visible from any given viewpoint
• games and physical simulations require detecting when and where
objects collide.
• All these needs can be supported by various spatial data structures
Bounding Boxes
• A Binary Space Partitioning Tree (or BSP Tree) is a data structure that is
used to organize objects within a space. Within the field of computer
graphics, it has applications in hidden surface removal and ray tracing.

The ray is only tested for intersection with the surfaces if it hits the
bounding box.
Bounding Boxes
Hierarchical Bounding Boxes
• The basic idea of hierarchical bounding boxes can be seen by the
common tactic of placing an axis-aligned 3D bounding box around all
the objects.
• The bounding box and the hierarchical bounding box method are used
to detect the collision
Spatial Partitioning
• space partitioning divides a space into non-overlapping regions.
• Space-partitioning systems are often hierarchical.
• The regions can be organized into a tree, called a space-partitioning tree.
• Space partitioning is particularly important in computer graphics, especially
heavily used in ray tracing.
• Storing objects in a space-partitioning data structure (k-d tree or BSP tree
for example)
• Space partitioning is also often used in scanline algorithms to eliminate the
polygons out of the camera's viewing frustum.
• There is also a usage in collision detection.

You might also like