|
I have an object that I want to get moved in a direction that is controlled by flow arrows placed in the scene. The arrows could just be game objects that push in their Z direction by an amount corresponding to their Z scale. This could be used for moving an object floating in a water stream, an air stream, or for defining weird custom gravity. Maybe the object should be moved by only the arrow that is closest at any given time, or maybe by a blend (interpolation) of the closest arrows around the object. A) How do I efficiently find the one closest arrow? B) How do I efficiently find the closest arrows around the object (neighbors) and interpolate between their directions such the the closest ones have most effect?
(comments are locked)
|
|
The problem is really two different issues: 1) Find the closest arrows efficiently. 2) (Only needed for B) Interpolate between the closest arrows. You have solve 1) in a number of different ways.
There are more ways this can be done, but the above should provide a good starting point. As for solving issue 2), that is a problem of multivariate interpolation in a non-uniform grid.
There are many other methods. Look for research in "Scattered Data Interpolation" to learn more. Thanks, Rune. I'm looking to do a similar gravity vector field and your comments are very helpful.
Feb 14 at 02:42 PM
panta
(comments are locked)
|
