View Full Version : Collision Detection - Distance between two objects

05-09-2015, 01:41 AM

I should implement a collision detection by using a bounding sphere. First I calculated the center point of my object - a pyramide. Then I calculated the radius by finding out the biggest distance from the center point to another point of the object.

My problem is the following: How can I compare the distance of two center points of two objects? All I know are the vertices of the two objects, but not the pixel coordinates in world coordinates.

Do you know a solution?

05-09-2015, 03:09 AM
Let`s get this straight. The only thing you know is two sets of object coordinates relative to their respective centers. OK.
How come you don`t know where your objects` centers reside?

05-12-2015, 02:10 PM
can I get a little help, please!

05-12-2015, 06:05 PM
sorry wrong thread

05-12-2015, 06:33 PM
Distance = vec1 - vec2;
where vec1 = the first object center point vector, vec2, the second.