barycentric interpolation

18
Barycentric Interpolation How do you interpolate values defined at vertices across the entire triangle?

Upload: lamkhue

Post on 05-Jan-2017

220 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Barycentric Interpolation

Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?

Page 2: Barycentric Interpolation

Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?

Solve a simpler problem first:

x1

x2

Page 3: Barycentric Interpolation

Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?

Solve a simpler problem first:

x1

x2

t

Want to define a value for every t ε [0,1]:

0

0

1

1t

Page 4: Barycentric Interpolation

Barycentric Interpolation

How do we come up with this equation?Look at the picture!

tt

Page 5: Barycentric Interpolation

Barycentric Interpolation

The further t is from the red point, the more blue we want.

tt

Page 6: Barycentric Interpolation

Barycentric Interpolation

The further t is from the red point, the more blue we want.

The further t is from the blue point, the more red we want.

tt

Page 7: Barycentric Interpolation

t

Barycentric Interpolation

The further t is from the red point, the more blue we want.

The further t is from the blue point, the more red we want.

Percent blue = (length of blue segment)/(total length)

Page 8: Barycentric Interpolation

t

Barycentric Interpolation

The further t is from the red point, the more blue we want.

The further t is from the blue point, the more red we want.

t

Percent blue = (length of blue segment)/(total length)Percent red = (length of red segment)/(total length)

Page 9: Barycentric Interpolation

t

Barycentric Interpolation

The further t is from the red point, the more blue we want.

The further t is from the blue point, the more red we want.

t

Percent blue = (length of blue segment)/(total length)Percent red = (length of red segment)/(total length)

Value at t = (% blue)(value at blue) + (% red)(value at red)

Page 10: Barycentric Interpolation

Barycentric Interpolation

The further t is from the red point, the more blue we want.

The further t is from the blue point, the more red we want.

t

Percent blue = tPercent red = 1-tValue at t = tx1 + (1-t)x2

x1

x2

t0

1

Page 11: Barycentric Interpolation

Barycentric Interpolation

Now what about triangles?

Page 12: Barycentric Interpolation

Barycentric Interpolation

Now what about triangles?

Just consider the geometry:

What’s the interpolatedvalue at the point p?

p

x1

x2

x3

Page 13: Barycentric Interpolation

Barycentric Interpolation

p

x1

x2

x3

Last time (in 1D) we usedratios of lengths.

t

Page 14: Barycentric Interpolation

Barycentric Interpolation

Now what about triangles?

Just consider the geometry:

p

What about ratios of areas (2D)?

Page 15: Barycentric Interpolation

Barycentric Interpolation

Now what about triangles?

Just consider the geometry:

p

If we color the areas carefully,the red area (for example)covers more of the triangle asp approaches the red point.

Page 16: Barycentric Interpolation

p

Barycentric Interpolation

Just like before:percent red = area of red triangle

total area

percent green = area of green triangletotal area

percent blue = area of blue triangletotal area

Page 17: Barycentric Interpolation

p

Barycentric Interpolation

Just like before:

Value at p:

(% red)(value at red) +(% green)(value at green) +(% blue)(value at blue)

percent red = area of red triangletotal area

percent green = area of green triangletotal area

percent blue = area of blue triangletotal area

Page 18: Barycentric Interpolation

p

x3

A3

A1

A1

A2

x1

x2

Barycentric Interpolation

“barycentric interpolation”a.k.a. “convex combination”a.k.a. “affine linear extension”

Just like before:Why? Look at the picture!

“barycentriccoordinates”

= λ1

Σi λi=1

= λ2

= λ3

Value at p:

(A1x1 + A2x2 + A3x3 )/A

percent red = AA2AA3A

percent green =

percent blue =

Now convert this to a bunch of ugly symbols if you want... just don’t think about it that way!