Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / mathematical collision detection

Author
Message
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th May 2006 02:19 Edited at: 14th May 2006 02:20
is it possible to find out if a point is "within" a 3d model (basically to test for collision). For instance, in a world with randomly sized & randomly moving objects, your goal would be to (mathematically) find out which object is closest when 2+ intersect the line. You can't use the distance formula with the centers, because if one is small and close, but inside a larger one, According to their centers, the smaller one is closer, but according to the model itself,the larger one is closer.

In short, my question is: Without using objects to check for collision, is there a way to check to see if a point is on or inside of a 3d object, and how would I go about doing that? I am using DBC.

I hope this makes sense.

Thanks in advance
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 14th May 2006 06:44
With either using the Intersect Object command or Sparky's collision dll you can determine if a point on one model is inbetween tow points in 3D Space. To check if a point is precisely inside a polygonal object, youd;

- Create a limb or mathematically aquire a point in 3D space that is infront of the user in the direction the user is moving;

- Get the intersection with the user's object starting from the user's position, ending at the limbs position. This gives you the central distance from the middle of the model to the outside at a given point.

- Using this distance, offset the limb appropirately so that its right on the surface of the model.

- Check for intersection with the other objects inbetween the user's coordinates and the limb.

That will give you perfect collision detection for non-boolean objects (objects that dont have holes in them). Ofcourse it isnt quite mathematical, but if you did want to take that further step into doing it mathematically you could obtain the vertex data of the models, get their slopes (angles) in relation to the model's position, and check if one of the model's vertex points is intersecting the normals of the other model through comparing vertex positions/slopes.

However I dont believe there is a way to actually calculate if a point is within a polygonal object mathematically using a given formula.

- RUC'

Login to post a reply

Server time is: 2024-09-24 23:32:57
Your offset time is: 2024-09-24 23:32:57