Game Development Reference
In-Depth Information
Figure 9.18
Examples of barycentric
coordinates
Let's make a few observations here. First, notice that the three vertices
of the triangle have a trivial form in barycentric space:
(1,0,0) ≡ v 1 ,
(0,1,0) ≡ v 2 ,
(0,0,1) ≡ v 3 .
Second, all points on the side opposite a vertex will have a zero for the
barycentric coordinate corresponding to that vertex. For example, b 1 = 0
for all points on the line containing e 1 (which is opposite v 1 ).
Finally, any point in the plane can be described in barycentric coordi-
nates, not just the points inside the triangle. The barycentric coordinates
of a point inside the triangle will all be in the range [0,1]. Any point outside
the triangle will have at least one negative coordinate. Barycentric space
tessellates the plane into triangles of the same size as the original triangle,
as shown in Figure 9.19.
There's another way to think about barycentric coordinates. Discarding
b 3 , we can interpret (b 1 ,b 2 ) as regular (x,y) 2D coordinates, where the
origin is at v 3 , the x-axis is v 1 v 3 , and the y-axis is v 1 v 2 . This can be
made more explicit by rearranging Equation (9.17):
(b 1 ,b 2 ,b 3 ) ≡ b 1 v 1 + b 2 v 2 + b 3 v 3
≡ b 1 v 1 + b 2 v 2 + (1 − b 1
Interpreting (b 1 , b 2 ) as
ordinary 2D coordinates
− b 2 ) v 3
≡ b 1 v 1 + b 2 v 2 + v 3 − b 1 v 3 − b 2 v 3
v 3 + b 1 ( v 1 v 3 ) + b 2 ( v 2 v 3 ).
This makes it very clear that, due to the normalization constraint, al-
though there are three coordinates, there are only two degrees of freedom.
We could completely describe a point in barycentric space using only two of
the coordinates. In fact, the rank of the space described by the coordinates
 
Search WWH ::




Custom Search