Hi,
I’ve been trying to get kind of a straight answer on how to bilinearly interpolate vectors, but “googling” is only getting me so far. Or maybe I’m just missing something. Preferably I’d like to learn how to do it using Unity’s API, but if that’s not possible, I’m up for any other options.
The problem:
Lets say I have a grid cell (on a standard square grid of points – Cartesian coordinates I believe they are called). So lets say I have four points making up a cell: Their coordinates are (0,0,0), (1,0,0), (1,0,1) and (0,0,1) – so essentially a square cell with it’s bottom-left point at (0,0,0). So far, all I need is the x-z plane, I’m leaving out the y-axis, as it’s not needed at this time. So technically I could use Vector2’s as well – either Vector3 or Vector2 would be fine, but I just need to bilinearly interpolate.
At each of these points I have a vector, and each vector could be anything, any direction, with any magnitude. Make up whatever you wish. If, for example, I have a unit at a coordinate point within this square cell, how could I bilinearly interpolate the four vectors (at the four corners given above) – in order to calculate what the units “combination vector” should be? Again, the unit’s location would be contained IN the cell boundaries.
So far everything I’ve looked at gives how to linearly or bilinearly interpolate coordinate points, but NOT vectors. I’m trying to learn how to interpolate vectors themselves.
Thanks for any help, or let me know if you need more explanation. Thanks!