I'm having a difficult time relating barycentric coordinates within a triangle to Texture coordinates. Is there an effective way of thinking of this relation?

ngod

I don't really get what the concrete rules for the (u,v) coordinates are. Do we simply choose two orthogonal vectors on the plane of our object (triangle, cube face etc) and then convert from (x,y) to (u,v)?

keenan

@nrauen Texture coordinates are given only at vertices. When you need to evaluate the texture coordinate at some other point (x,y) inside the triangle, you interpolate the vertex values using barycentric coordinates. Once you have this interpolated texture coordinate (u,v), you look up the color value at (u,v) in the texture image. This color determines the fcolor at (x,y) in the output image (frame buffer).

keenan

@ngod The (u,v) coordinates let you specify which part of the texture is going to be copied into your triangle to give it color. The example on this slide is perhaps a bit confusing because both the geometry (a cube) and the texture coordinates are very “axis aligned.” A much better (i.e., more generic) example can be seen here.

I'm having a difficult time relating barycentric coordinates within a triangle to Texture coordinates. Is there an effective way of thinking of this relation?

I don't really get what the concrete rules for the (u,v) coordinates are. Do we simply choose two orthogonal vectors on the plane of our object (triangle, cube face etc) and then convert from (x,y) to (u,v)?

@nrauen Texture coordinates are given only at vertices. When you need to evaluate the texture coordinate at some other point (x,y) inside the triangle, you interpolate the vertex values using barycentric coordinates. Once you have this interpolated texture coordinate (u,v), you look up the color value at (u,v) in the texture image. This color determines the fcolor at (x,y) in the output image (frame buffer).

@ngod The (u,v) coordinates let you specify which part of the texture is going to be copied into your triangle to give it color. The example on this slide is perhaps a bit confusing because both the geometry (a cube) and the texture coordinates are very “axis aligned.” A much better (i.e., more generic) example can be seen here.