I'm working on a program that models scientific data (geophysical resistivity) in 3d. I have a function calculates a value for any point (x,y,z) underground. I need to create an OpenGL object that is a 'shell' (think 3d topographic map) where the calculated value is within a certain user-defined range. If that description doesn't make sense, an analogy could be a program that generates an OpenGL model of a skeleton given CAT scan data. There are two main problems that I'm having a hard time figuring out:
1) The function that computes a resistivity value given a position is necessarily computationally expensive, so I'd like to call it as little as possible.
2) There may be multiple 'shells' and I can't figure out how to tell when this is the case.
I'd appreciate any pointers, source code, algorithm names, or whatever. Thanks!!