<s>
In	O
computer	O
graphics	O
,	O
a	O
triangle	B-Algorithm
mesh	I-Algorithm
is	O
a	O
type	B-Algorithm
of	O
polygon	B-Algorithm
mesh	I-Algorithm
.	O
</s>
<s>
Many	O
graphics	B-Application
software	I-Application
packages	O
and	O
hardware	O
devices	O
can	O
operate	O
more	O
efficiently	O
on	O
triangles	O
that	O
are	O
grouped	O
into	O
meshes	B-Algorithm
than	O
on	O
a	O
similar	O
number	O
of	O
triangles	O
that	O
are	O
presented	O
individually	O
.	O
</s>
<s>
In	O
a	O
large	O
mesh	B-Algorithm
,	O
there	O
could	O
be	O
eight	O
or	O
more	O
triangles	O
meeting	O
at	O
a	O
single	O
vertex	B-Algorithm
-	O
by	O
processing	O
those	O
vertices	O
just	O
once	O
,	O
it	O
is	O
possible	O
to	O
do	O
a	O
fraction	O
of	O
the	O
work	O
and	O
achieve	O
an	O
identical	O
effect	O
.	O
</s>
<s>
In	O
many	O
computer	O
graphics	O
applications	O
it	O
is	O
necessary	O
to	O
manage	O
a	O
mesh	B-Algorithm
of	O
triangles	O
.	O
</s>
<s>
The	O
mesh	B-Algorithm
components	O
are	O
vertices	O
,	O
edges	O
,	O
and	O
triangles	O
.	O
</s>
<s>
An	O
application	O
might	O
require	O
knowledge	O
of	O
the	O
various	O
connections	O
between	O
the	O
mesh	B-Algorithm
components	O
.	O
</s>
<s>
These	O
connections	O
can	O
be	O
managed	O
independently	O
of	O
the	O
actual	O
vertex	B-Algorithm
positions	O
.	O
</s>
<s>
Many	O
other	O
types	O
exist	O
and	O
have	O
support	O
for	O
various	O
queries	O
about	O
meshes	B-Algorithm
.	O
</s>
<s>
Various	O
methods	O
of	O
storing	O
and	O
working	O
with	O
a	O
mesh	B-Algorithm
in	O
computer	O
memory	O
are	O
possible	O
.	O
</s>
<s>
With	O
the	O
OpenGL	B-Application
and	O
DirectX	B-Application
APIs	B-General_Concept
there	O
are	O
two	O
primary	O
ways	O
of	O
passing	O
a	O
triangle	B-Algorithm
mesh	I-Algorithm
to	O
the	O
graphics	O
hardware	O
,	O
triangle	O
strips	O
and	O
index	O
arrays	O
.	O
</s>
<s>
One	O
way	O
of	O
sharing	O
vertex	B-Algorithm
data	O
between	O
triangles	O
is	O
the	O
triangle	O
strip	O
.	O
</s>
<s>
Another	O
way	O
is	O
the	O
triangle	B-General_Concept
fan	I-General_Concept
which	O
is	O
a	O
set	O
of	O
connected	O
triangles	O
sharing	O
one	O
central	O
vertex	B-Algorithm
.	O
</s>
<s>
Triangle	O
strips	O
are	O
efficient	O
,	O
however	O
the	O
drawback	O
is	O
that	O
it	O
may	O
not	O
be	O
obvious	O
how	O
or	O
convenient	O
to	O
translate	O
an	O
arbitrary	O
triangle	B-Algorithm
mesh	I-Algorithm
into	O
strips	O
.	O
</s>
<s>
The	O
data	O
structure	O
representing	O
the	O
mesh	B-Algorithm
provides	O
support	O
for	O
two	O
basic	O
operations	O
:	O
inserting	O
triangles	O
and	O
removing	O
triangles	O
.	O
</s>
<s>
The	O
structure	O
provides	O
no	O
support	O
for	O
the	O
vertex	B-Algorithm
positions	O
,	O
but	O
it	O
does	O
assume	O
that	O
each	O
vertex	B-Algorithm
is	O
assigned	O
a	O
unique	O
integer	O
identifier	O
,	O
typically	O
the	O
index	O
of	O
that	O
vertex	B-Algorithm
in	O
an	O
array	O
of	O
contiguous	O
vertex	B-Algorithm
positions	O
.	O
</s>
<s>
A	O
mesh	B-Algorithm
vertex	B-Algorithm
is	O
defined	O
by	O
a	O
single	O
integer	O
and	O
is	O
denoted	O
by	O
hvi	O
.	O
</s>
<s>
A	O
mesh	B-Algorithm
edge	O
is	O
defined	O
by	O
a	O
pair	O
of	O
integers	O
hv0	O
,	O
v1i	O
,	O
each	O
integer	O
corresponding	O
to	O
an	O
end	O
point	O
of	O
the	O
edge	O
.	O
</s>
<s>
A	O
triangle	O
component	O
is	O
defined	O
by	O
a	O
triple	O
of	O
integers	O
hv0	O
,	O
v1	O
,	O
v2i	O
,	O
each	O
integer	O
corresponding	O
to	O
a	O
vertex	B-Algorithm
of	O
the	O
triangle	O
.	O
</s>
<s>
Vertex	B-Algorithm
v0	O
is	O
adjacent	O
to	O
edges	O
e0	O
and	O
e2	O
and	O
to	O
triangle	O
t	O
.	O
Vertex	B-Algorithm
v1	O
is	O
adjacent	O
to	O
edges	O
e0	O
and	O
e1	O
and	O
to	O
triangle	O
t	O
.	O
Vertex	B-Algorithm
v2	O
is	O
adjacent	O
to	O
edges	O
e1	O
and	O
e2	O
and	O
to	O
triangle	O
t	O
.	O
All	O
three	O
edges	O
e0	O
,	O
e1	O
,	O
and	O
e2	O
are	O
adjacent	O
to	O
t	O
.	O
</s>
<s>
The	O
information	O
stored	O
at	O
a	O
vertex	B-Algorithm
,	O
edge	O
,	O
or	O
triangle	O
is	O
referred	O
to	O
as	O
the	O
vertex	B-Algorithm
attribute	O
,	O
edge	O
attribute	O
,	O
or	O
triangle	O
attribute	O
.	O
</s>
<s>
This	O
operation	O
involves	O
identifying	O
an	O
edge	O
hvk	O
,	O
vti	O
where	O
vk	O
is	O
called	O
the	O
keep	O
vertex	B-Algorithm
and	O
vt	O
is	O
called	O
the	O
throw	O
vertex	B-Algorithm
.	O
</s>
<s>
The	O
triangles	O
that	O
share	O
this	O
edge	O
are	O
removed	O
from	O
the	O
mesh	B-Algorithm
.	O
</s>
<s>
The	O
vertex	B-Algorithm
vt	O
is	O
also	O
removed	O
from	O
the	O
mesh	B-Algorithm
.	O
</s>
<s>
Any	O
triangles	O
that	O
shared	O
vt	O
have	O
that	O
vertex	B-Algorithm
replaced	O
by	O
vk	O
.	O
</s>
<s>
Figure	O
1	O
shows	O
a	O
triangle	B-Algorithm
mesh	I-Algorithm
and	O
a	O
sequence	O
of	O
three	O
edge	O
collapses	O
applied	O
to	O
the	O
mesh	B-Algorithm
.	O
</s>
<s>
With	O
index	O
arrays	O
,	O
a	O
mesh	B-Algorithm
is	O
represented	O
by	O
two	O
separate	O
arrays	O
,	O
one	O
array	O
holding	O
the	O
vertices	O
,	O
and	O
another	O
holding	O
sets	O
of	O
three	O
indices	O
into	O
that	O
array	O
which	O
define	O
a	O
triangle	O
.	O
</s>
<s>
In	O
OpenGL	B-Application
,	O
this	O
is	O
supported	O
by	O
the	O
glDrawElements( )	O
primitive	O
when	O
using	O
Vertex	B-Library
Buffer	I-Library
Object	I-Library
(	O
VBO	O
)	O
.	O
</s>
<s>
With	O
this	O
method	O
,	O
any	O
arbitrary	O
set	O
of	O
triangles	O
sharing	O
any	O
arbitrary	O
number	O
of	O
vertices	O
can	O
be	O
stored	O
,	O
manipulated	O
,	O
and	O
passed	O
to	O
the	O
graphics	O
API	B-General_Concept
,	O
without	O
any	O
intermediary	O
processing	O
.	O
</s>
