You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 5: Texture Mapping (24)
StaffMichaelRenMR

If you wanted to create a smooth gradient across a square rather than a triangle, how could you use barycentric coordinates to achieve this?

yzliu567

If it's a square, then we can use bilinear interpolation mentioned later in the slides.

fyhannes

could you break the square into two triangles and blend their interpolated values?

jonathanlu31

Do barycentric coordinates exist for shapes other than triangles? Couldn't you interpolate values for the colors inside a square by expressing an inner point as a convex combination of the vertices and weight the colors using the coefficients like the same strategy as this slide?

StaffMichaelRenMR

@yzliu567 @fyhannes both your suggestions would work in producing a smooth gradient between colors at each point!

@jonathanlu31 Yes that would work too; one way to think about the weighting is that the point to be colored is the center of mass of the vertices. So for a square, if each vertex had weight 1/4, this would map to the center of the square. If instead one of the vertices had point 0, the other 3 vertices would act as a triangle barycentric coordinate system. This can be done in general for convex quadrilaterals, not just squares!

prannaypradeep999

Does the mathematical implementation of Barycentric coordinates differ for different shapes (i.e a rectangle vs a square vs a triangle)? I understand that the vertices will likely have different weights, but is there anything else different about its representation?

sZwX74

The mathematical representation of each point as a weighted combination of the vertices should not change, but I'm not confident that all of the mathematical properties continue to hold, because the official definition of Barycentric coordinates is only defined on triangles or triangle-like objects (tetrahedra in 3D). However, each property we showed here could probably be shown one way or another on quadrilaterals.

Staffjamesfobrien

Barycentric coordinates can be used with any N-dimensional simplex (point, line, triangle, tetrahedron, ...) .

If you use it for something with more vertices (eg quad or cube) then it becomes underdetermined. You still have the convex hull property if sum(weights) == 1 and all(weights) > 0, but there will be more than one set of weights for any given point in space.

There have been a number of efforts to extend the idea to arbitrary polygons in a way that is useful. One idea is Mean Value Coordinates another is Harmonic Coordinates. https://graphics.pixar.com/people/derose/publications/indexAuthorJoshi.html

joeyzhao123

When you go up dimensions, would you also have more "colors" for each vertex? Or does it still work with 3.

Unicorn53547

I will assume it won't be restricted by dimensions. For high dimensions, you can just repeat the process for each channel and thus get a high-dim coordinate.

You must be enrolled in the course to comment