Figuring out the distance between two points on a 3d plane is not all that difficult, the way I am thinking (which could be wrong, mind you), but it's definitely a two step process, and there is probably someone out there that has the real equasion(sp) to figure this out quickly and correctly in one step, but until that person comes around, here is my "solution":
Step 1. Ignore Z (for now), calculate the distance on just the XY plane between the two points. Now, keep the distance between the two points handy, because you will need it in the next step.
Step 2. Take the distance from step 1, use it as one side of the triangle, now, take the Z difference and use that as the second side of the triangle, calculate the distance on that, and bang. All done, the distance between two three dimensional points.
With that distance, you can multiply the force out, and split it into it's three vectored components (which I can't remember how to do, so it's up to you). Anyways, even if I am wrong, it was fun even thinking about it, thanks for the change up from the regular web-programming side of things (read from db, draw form, handle form, write to db)
|