Triangle Barycentrics CMSC 435634 Barycentric Coordinates Weighted average
Triangle Barycentrics CMSC 435/634
Barycentric Coordinates • Weighted average of vertex positions – Weights a, b, g ; a + b + g = 1 – • Same weight can interpolate other data –
Barycentric Coordinates • Each coordinate is 1 at its vertex • 0 at both other vertices – and on the line between them
Computing Barycentrics (1) • Ratio of (signed) distance from edge
Computing Barycentrics (2) • Ratio of (signed) triangle areas • Since • Everything but h’s cancel
Computing Barycentrics (2 a) • Area with cross product • Dot with normal for sign
Computing Barycentrics (2 b) • Skip normalization
Computing Barycentrics (2 c) • Area from matrix determinant
Computing Barycentrics (2 d) • Area by Green’s Theorem
Computing Barycentrics (3) • System of equations • a, b, and g are linear in X and Y
Computing Barycentrics (3) • Each barycentric is – Equal to 1 at one vertex – Equal to 0 at the other two
Computing Barycentrics (3) • This defines a system of three equations • or
Computing Barycentrics (3) • Solve for coefficients for all three:
Computing Barycentrics (3) • Matrix Inverse
Computing Barycentrics (3) • Solve for a coefficients
Computing Barycentrics (3) • At
Computing Barycentrics • Bottom Line: – Lots of ways to compute them – All algebraically equivalent • Use the one that you find easiest
- Slides: 17