Lecture 5: Texture Mapping (14)
andrewdcampbell

Are we also enforcing that $0 \leq \alpha, \beta, \gamma \leq 1$ (i.e. do we also use Barycentric coordinates for points outside the triangle?)

RichardChen9

I found an image that is kinda useful for seeing how points in the triangle can be weighted sums of the A, B, and C vectors: https://www.geogebra.org/resource/rFQK2EH3/HIoTiK5c1vcViqV8/material-rFQK2EH3-thumb@l.png

raghav-cs184

Are there ways to use barycentric coordinates to reduce the amount of information we have to store? For example, if we have a large region of uniform color in an image and a small region of non-uniform color, would it make sense to store the large region using 3 coordinates (far apart) with the same color, and use many triangles for the non-uniform region? Is there a way to "grow" triangles to decrease the data density required?

wangcynthia

An extension to this slide that my TA mentioned in discussion: If any of the weights are negative but they all still add up to 1, then the point (x, y) will be outside of the triangle but still in the same plane as the triangle!

kevinliu64

Is this essentially assigning each x,y coordinate a value dependent on the 3 vertices that surround it?

zehric

@raghav-cs184 your idea is pretty interesting! I think there are definitely tradeoffs between the two that are worth exploring. If there are a lot of fine details in the region of non-uniform color I think it might be better to use texture mapping rather than color interpolation of small triangles, though.

killawhale2

@raghav-cs184 The idea of using bigger triangles to store uniform color regions is interesting but the varying size of triangles might induce other complexities down the pipeline. I would assume that there are sizes for triangles that are "on average" best at storing information and keeping complexity down, depending on the characteristics of the image.

edricx

One way of thinking about barycentric coordinates that may be helpful for intuition is that "barycenter" actually means center of mass. The 3 coordinate values can be thought of as weights placed on each of the vertices. https://en.wikipedia.org/wiki/Barycentric_coordinate_system

go-lauren

@kevinliu64 Yes, the barycentric coordinates of (x, y) totally depend on the where A, B, and C are oriented around it. Barycentric actually means the center of weight, or more intuitively, if you placed the triangle on a stick at the point (x, y), the weights alpha, beta, gamma are what you would have to put at A, B, and C to keep the triangle balanced. So if the point is closer to A, you'd have to have more weight at B and C to balance the weight at A. Negative barycentric coordinates would imply that the point (x, y) is outside of the triangle. A negative weight at a vertex would be the amount of weight you'd have to place on the opposite side of the point (x,y) from the vertex to keep the triangle balanced.

sheaconlon

It seems kind of strange that barycentric coordinates are not minimal (eg. there are three coordinates when the space is only two-dimensional).

AronisGod

There are three coordinates if one thinks of it this way. Take one point to be the origin, thus constituting the first coordinate (origin shift) The other two coordinates represent the linear combination of weights for the basis vectors extending from your new origin.

xiaoyankang

I found this website (https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-rendering-a-triangle/barycentric-coordinates) particularly useful in helping me understand the barycentric coordinates. It gives detailed walkthrough of the equation aided with diagrams. It also gives a c++ program for computing barycentric coordinates.

You must be enrolled in the course to comment