3d interpolation help please?
-
Okay, so I have a 2d array, with the 2 dimensions representing X width and Z depth. The values stored represent the Y heights. Like this:
[0,1], [4,2] ]
So if I have a thing at position [0][0], the height is 0, and if I have a thing at position[0][1], the height is 2.
I want to be able to interpolate the values so that I can find out what the height would be if my thing was at a hypothetical position [0.5][0.3] (for example). I hope you understand what I mean.There’s a lerp() function here, which interpolates between two numbers, which my brain has absolutely no trouble understanding, but I can’t wrap my head around this ’2 dimensions, 4 points’ thing for some reason...
Can anybody help?
-
This post is deleted! -
Thanks. I was getting confused because you can go left to right first or up and down first. But whatever direction you pick first, you only do the second one once...
It’s getting there.
-
This post is deleted!