Separating Two Intersecting Spheres

Started by
13 comments, last by mrbig 17 years, 8 months ago
Quote:Original post by mrbig
See how you all got it all wrong? :P

No, I don't see how I got it wrong.

Quote:The solution to my question (yet again) appears to involve complex calculations.

It involves solving a second-degree equation, which is taught to 12-year olds in school. I fail to see how that is "complex calculations".
Advertisement
Use alvaro's line->sphere solution, it's "obviously" correct (sorry ToohrVyk but whilst your solution (if I interpretted it correctly) is correct it's not "obviously" so...!) and you can get the answer from 6 million places on the internet with no trouble.

I still say I answered your question correctly the first time - you just didn't ask the correct question :) You had a very specific direction in mind - not an arbitrary one.
Ok Alvaro, so not all of you got it all wrong.
Does that really matter?
Solving 2nd degree equations 400 times per pair of objects each frame doesn't sound like a good idea to me.

Mr. Rowl, whether the direction is specific or arbitrary doesn't matter.
That way or another, there are no wrong questions, only wrong answers.
Quote:Original post by mrbig
Ok Alvaro, so not all of you got it all wrong.
Does that really matter?
Solving 2nd degree equations 400 times per pair of objects each frame doesn't sound like a good idea to me.

Mr. Rowl, whether the direction is specific or arbitrary doesn't matter.
That way or another, there are no wrong questions, only wrong answers.


Why would you have to perform this 400 times per pair, surely once would be enough? The trick to fast collision detection isn't so much in the speed of the intersection test itself but rather in the method you use to cull the number of tests you have to perform anyway. Even so, solving such an equation isn't such a costly operation. If you have many objects what you want to do is use spatial partitioning and/or take advantage of temporal coherence in order to make the time taken as linearly dependant on the number of objects as possible rather than being an n squared process which results from brute force. I recommend you look into collision culling methods such as 'sweep and prune' and 'quad trees' before you start worrying about saving a few cycles on the actual narrow phase intersection test used.

And for the record whether the direction is specific or arbitrary is far from insignificant. In fact I'd say that is the sole reason why you perceive one answer to be correct and the others wrong.
[size="1"] [size="4"]:: SHMUP-DEV ::
There we go again... Read my posts!
I said I want to approximate my objects using spherical voxels.
400 tests per pair might be a bit too much, but I'm always prepared for the worse! xD
Anyway, looking at my rating I can clearly see where this is all going, so thanks everybody, and good day.

This topic is closed to new replies.

Advertisement