# Geometric Collision Detection

This topic is 3956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. I need a collision detection algorithm. To simplify problems, I just need to see if a given point is inside a geometric solid. Each object has a location, where its center is, and has a rotation in the XZ plane and the Y plane. I suspect this last requirement makes the problem most difficult. Can you help me? Thanks, Geometrian

##### Share on other sites
Quote:
 Original post by GeometrianHi. I need a collision detection algorithm. To simplify problems, I just need to see if a given point is inside a geometric solid. Each object has a location, where its center is, and has a rotation in the XZ plane and the Y plane. I suspect this last requirement makes the problem most difficult. Can you help me?Thanks,Geometrian
What do you mean by the 'Y plane'? Also, are the solids convex or non-convex?

The orientation of the solid really doesn't matter much; it's whether or not the object is convex that will determine the choice of algorithm.

##### Share on other sites
Well, it has a pitch and a rotation. I'm not sure how to describe it, so here's a picture:
http://en.wikipedia.org/wiki/Spherical_coordinates
...but instead of plotting points, those are the orientations of the angles.

The solids are mostly the platonic solids. (Tetrahedron, Hexahedron (Cube), Dodecahedron, Icosahedron, etc.).

##### Share on other sites
For fast collision detection you can use bounding volumes. and if one point is inside that bounding volume you can check for every planes for more accurate results. this is depends on ur object shape. if your object shape is somewhat spherical you can use bounding volume as sphere. and checking a point in sphere i s very easy & fast.

##### Share on other sites
Well, there will be some sort of basic collision detection like that, just to save time, but I'll need some refining collision detection code for that passers of that test.

An icosahedron is bounded fairly well by a sphere, a tetrahedron certainly is not.

##### Share on other sites
The way in which the orientation is represented doesn't really matter; as long as you have a transform associated with the solid, you can always transform the query point into the local space of the solid by way of the inverse of the transform matrix.

After that you would perform the half-space test, as previously mentioned.

##### Share on other sites
Great!

I need to know how to do that though.

Also, I'm not sure what you mean by half-space test. And I need to know how to do that too.

I think these questions are more what I meant by my original question.

##### Share on other sites
I've reduced the problem to just finding which side of a plane the point is on.

Here's the way my collision detection will work:
Bounding sphere detection
If passes, rotate point into object space
Bounding box detection.
If passes, then polygonal test. (Here's what I need help with).

I can specify each face of, say, a tetrahedron, by its points.
(Vertices at (0,0,0),(1,1,1),(0,1,0),(1,0,0), or something).
Then, for each triangle, (in the case of the tetrahedron there will be four). I will determine if the point is past its inside edge. (Inside meaning the inside of the tetrahedron). I specify the normal to the plane. If the point is on the opposite side as the normal, then the point hits.

Thus, by seeing if the point in question is a solution to all of the polygons' planar equations, we can see if the point hit the object.

In short, I would like someone to tell me how, given a point, how to write a function, which, when passed a triangle's points and the triangle's normal, will return true if it is on the opposite side of the normal and return false if it is on the same side.

Thanks,

G

1. 1
2. 2
3. 3
4. 4
Rutin
15
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013551
×