Never mind. I've just thought of a way to do it:
Take the point I want to map onto the grid. Calculate
the intersection of a line passing through that given
point (using the normal of the plane) and the water-plane.
Dissect the intersection-point with the span-vectors,
and calculate their lengths. Divide lengths by respective
distance between nodes. Round the results, and voila!
I got the indices for the nearest node.
I'm a little proud of myself. :-)
Anyone know if this algorithm already exists, or if there
is a faster way?
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde
Post a reply to this message
|