PDA

View Full Version : 3d-Face-Collision



ReneMiner
30-04-2013, 23:01
I'm currently thinking about a simple face-collision and how to calculate it. Maybe someone is able to think the idea to an end ;)


I have the following - thoughts in degrees°...

1. 3 Vectors, With Corner .X1,.Y1,.Z1/.X2,.Y2,.Z2/.X3,.Y3,.Z3 (which describe the corners of the face)
2. Center-Position of face calculated like Center.X = (.X1+.X2+.X3)/3, Center.Y = (.Y1+.Y2+.Y3)/3, Center.Z = (.Z1+.Z2+.Z3)/3 , End With
3. Face normals which describe a perpendicular vector to the surface, added to Center the Normals describe a Point that is in 1 Unit Distance
4. a point on a directional line from face-Center to faces corner in exact 1 Unit Distance from center describes the 0°-Direction while normals describe same point rotated altogether 90°
5. this 90°-Rotation is based somehow onto the Normal-Values - I guess it's 90 * Normal.X around one axis + 90 *Normal.Y around other axis + 90 * Normal.Z around third axis.
if a point P's distance from faces center is greater than distance from center to any corner (= Radius) then it can not intersect the face
if point P is AT AN angle >0° and angle<180° then point P does not intersect nor touch face else point P collides...so ATAN2 will tell somehow...

All these numbers and points dancing in my head:shock28:i think there are others that have broken their minds already with that,

I tried to find some information - but I do not understand the C-stuff as used here (http://www.cmsoft.com.br/?id=81&Itemid=132&layout=blog&option=com_content&view=category) or at nehe (http://nehe.gamedev.net/tutorial/collision_detection/17005/)-lessions and they think totally different ways...

SteveOW
04-05-2013, 15:21
[QUOTE=ReneMiner;88584]I'm currently thinking about a simple face-collision and how to calculate it. Maybe someone is able to think the idea to an end ;)

Hi Rene,

Not sure exactly what you mean by "simple" but the following pdf may be of interest http://www.geometrictools.com/Documentation/DynamicCollisionDetection.pdf
It describes method of oriented bounding boxes OBB for detecting intersection of 3D objects.

it is particulalry useful when you have large number of objects that need to be compared with each other.

This method I found very useful for predicting high precision collisions between large numbers of moving spheres (Example: https://www.youtube.com/watch?v=fK1XqA_KAQA)
My coding was done in VB6 and is rather old-fashioned as I do not understand matrices or modern graphics very well.

I suspect that the best technical approach would be to use one of the available C-libraries for high speed collision determination.
But I dont do "C".

There are some other posts on collision detection in this forum but I think their needs (gaming) were different to mine (scientific simulation).
For example see the sample application PONG which uses tgbl (Petr) and oxygen (Charles).


I am interested to see what you will produce.


Good luck,
Steve.