[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

collision detection

how do i detect collision between helicopter and very large  terrain which contains many mountains in direct3d using delphix.
0
f15iaf
Asked:
f15iaf
1 Solution
 
MotazCommented:
What did you mean by collision and meshes?
0
 
TheNeilCommented:
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
 
f15iafAuthor Commented:
Edited text of question.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

The Neil =>(
0
 
jeurkCommented:
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

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

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