Linear interpolation of cube corner vals inside cube

Started by
2 comments, last by dangerdaveCS 15 years, 5 months ago
This should be straightforward, but I have a feeling that there should be some mathematical law or something that I'm not using. I have a cube with each of the 8 corners assigned a different value. I have a point somewhere inside that cube. I need to find the linearly interpolated value at that point using the values at the 8 corners of the cube. The way I'm doing it now is to get each of the 8 corner values and use the distance to each over the total distance to all as the ratio of their contribution to the final value. I have a feeling, though, that at least the total distance to all the corners is a constant depending on cube size, but I have no idea what that is. Just ignore that previous paragraph if I'm waffling, my main problem remains, can anyone give me a general solution to this interpolation problem? Cheers,
Dave.
Advertisement
I don't know either, but I have a few suggestions:

- output the computed distance on the screen, so that you'll see what type of value it is, and maybe you'll start to suspect what kind of equation it is

- simplify the problem to 2d rectangle - draw a rectangle on a piece of paper, draw a point and connect it with two corners, and draw a line between two corners, and try to do sth with the triangle that you'll get

HTH
Hi.

This is a common problem within volume rendering and isosurfacing: given a cube with 8 values at its vertices, what is the value at a point p within the cube. The usual approach is to use trilinear interpolation. There are a lot papers describing this. For example, see the beggining os section 2 of this paper.
Quote:Original post by wolverine
For example, see the beggining os section 2 of this paper.


Awesome, exactly the info I needed, thanks. Looks like I was completely wrong in my previous implementation - which actually might just explain a few problems I've been having.

Thanks again.

Dave.

This topic is closed to new replies.

Advertisement