Jump to content
  • Advertisement
Sign in to follow this  
playmesumch00ns

bilinear interpolation in a quadrilateral

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a quadrilateral defined by four vertices, a, b, c and d. Each vertex has a colour value associated with it. I then have a point P which I know lies inside the quadrilateral. How do I get an interpolated colour value for P? Ideally I would like to get a weight for each vertex as I may have more than one value to interpolate. I remember deriving this at university. The method started with drawing a line, ef, that bisects ab and cd and passes through P, like so:
d -------- f ---- c
|             |        |
|             |        |
g -------- P ---- h
|             |        |
a -------- e ---- b
You then use the equality
(e-a)/(b-a) = (f-d)/(c-d)
as your starting point and you end up with an equation that you solve using the quadratic formula. So I know essentially what I have to do: I'm just getting fuzzy in the middle! Can anyone help me?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!