Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

collision detection

how do i detect collision between helicopter and very large  terrain which contains many mountains in direct3d using delphix.
1 Solution
What did you mean by collision and meshes?
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 =:)
f15iafAuthor Commented:
Edited text of question.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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

The Neil =>(
this is the best thing you will find : 
it has a component for delphiX that does exactly what you want...
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.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now