Barycentric Coordinates
Explore the concept of barycentric coordinates as a method to describe the position of any point within a triangle face in 3D models. Understand how these coordinates are calculated using geometric principles and how they apply to shading and rendering processes. This lesson enables you to implement barycentric coordinates in Python and use them for tasks like color interpolation within triangles.
Overview
The concept of barycentric coordinates comes up quite often in computer graphics applications. For example, given a textured 3D model, each face of the model needs some kind of mapping to the texture to know how it should appear. For a 3D model composed of 2D polygon faces, we need a way to describe the location of any 2D point on a face. Barycentric coordinates provide such a method to describe the relative location of a point on a face. Understanding what they are and how they work is integral to shading and rendering in particular.
Barycentric coordinates
To put it simply, barycentric coordinates are a local coordinate system for a triangle of geometry. They describe a single point on a triangle face as a combination of the three vertices of the triangle. In other words, for a triangle with vertices
Reasoning about barycentric coordinates
Imagine three springs and three points