Game Development Reference
In-Depth Information
To present these classic calculations, we follow Goldman's article [25]
from Graphics Gems. For each point, we discuss its geometric significance
and construction and give its barycentric coordinates.
The center of gravity is the point on which the triangle would balance
perfectly. It is the intersection of the medians. (A median is a line from
one vertex to the midpoint of the opposite side.) Figure 9.22 shows the
center of gravity of a triangle.
Figure 9.22
The center of gravity
of a triangle
The center of gravity is the geometric average of the three vertices:
c Grav = v 1 + v 2 + v 3
3
.
The barycentric coordinates are
1
3 , 1
3 , 1
.
3
The center of gravity is also known as the centroid.
The incenter is the point in the triangle that is equidistant from the
sides. It is called the incenter because it is the center of the circle inscribed
in the triangle. The incenter is constructed as the intersection of the angle
bisectors, as shown in Figure 9.23.
The incenter is computed by
c In = l 1 v 1 + l 2 v 2 + l 3 v 3
p
,
where p = l 1 +l 2 +l 3 is the perimeter of the triangle. Thus the barycentric
coordinates of the incenter are
l 1
p , l 2
p , l 3
.
p
Search WWH ::




Custom Search