Do any of you have any source of how to do collision detection in Visual Basic using Direct X 7.0 ?
Printable View
Do any of you have any source of how to do collision detection in Visual Basic using Direct X 7.0 ?
Well, there are more complicated methods, but the sphere-boundary one is useful enough. First, create a sphere large enough to hold the whole object, then compare the radii of that and another object's bounding sphere. If they collide, either claim a collision there, or move onto a slower but more accurate method, such as polygon piercing. I don't know too much, but it's a possibility.
To do that, would you identify the vector between the two sphere's centres and then check the length to see if it's less than the sum of the two radii? Or is there an easier method?
This isn't something I know about so I'm just interested.
anyone else have some code demos on how to do it. I will have a look on PSC for some stuff too.
That's exactly as Harry said...
Code:If sqr((A.X-B.X)^2+(A.Y-B.Y)^2+(A.Z-B.Z)^2)<ARadii+BRadii then ... (check for collisions with vertexes inside the other object)