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...
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...