x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 407

# collision detection

how do i detect collision between helicopter and very large  terrain which contains many mountains in direct3d using delphix.
0
f15iaf
1 Solution

Commented:
What did you mean by collision and meshes?
0

Commented:
It all depends on how complex your objects are and how many dimensions you are dealing with. A simple solution would be to treat everything as a sphere and then check to see if object 1's 'sphere' intersects with objects 2's.

e.g. Assume that object 1 can be encompased by a sphere of radius 5 and that object 2 can be encompassed by a sphere of radius 10. To check if the two have collided, check the distance between the two (from the centre points) and if it's less than the two radii combined then they have collided. Collision := (iDist <= (r1 + r2))
Calculating iDist can be done with simple Pythagorus: iDist := SQRT(SQR(x1 - x2) + SQR(y1 - y2)) This can be extended to 3 dimensions using the 3D version but I can't remember it off the top of my head

Hope that helps

The Neil =:)
0

Author Commented:
Edited text of question.
0

Author Commented:
Edited text of question.
0

Commented:
That's right, change the question after I give one of my better solutions

The Neil =>(
0

Commented:
hello,
this is the best thing you will find :
http://users.cybercity.dk/~bbl6194/delphi3dx.htm
it has a component for delphiX that does exactly what you want...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.