|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| General Collision Detection for Games Using Ellipsoids |
|
![]() ferceg Member since: 1/18/2000 From: Hungary |
||||
|
|
||||
| Has anyone implemented this system _successfully_ ? (I'm trying to, but sometimes I get strange results. (I'm getting closer to an edge (shared by 2 triangles - a column, for example), and then it throws me away... not always, but...)) Please help, if you can. |
||||
|
||||
![]() BiGCyC Member since: 4/5/2001 |
||||
|
|
||||
| Very good document on it at... http://www.peroxide.dk/tutorials/tut10/pxdtut10.html |
||||
|
||||
![]() ferceg Member since: 1/18/2000 From: Hungary |
||||
|
|
||||
| Thx ! Believe or not, I typed the words +collision +detection +sphere +sliding +gravity into altavista and that was the 2. link it returned :-) (So I'm reading it, now...) |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| The link to the peroxide.dk article no longer works. While this is an otherwise good article, I'm surprised that it bills itself as covering ellipsoids but doesn't cover rotation. An ellipsoid is going to have an axis of rotation--actually, I believe it can have two or three. I'm doing a project now with 2D ellipses, and the rotation problem makes finding the exact time of collision a hundred times more difficult. Unless your ellipsoids are always pointing the exact same way, which is unrealistic, this won't help you much to solve for their collisions. |
||||
|
||||
![]() Stezka Member since: 4/11/2001 From: Czech Republic |
||||
|
|
||||
| IMO this cannot work without certain modifications. I've tried to implement this quite long . Bad idea is the back tracing - when the CheckPointInTriangle fails and the sphere intersection point must be determined again by shooting a ray from PolygonIntersectionPoint (we got this point thanks to the ClosestPointOnTriangle function) in the direction of negative normalized velocity. I've foung a situation when the sphere is slightly above the vertical triangle and the backtracing ray will not hit the sphere althought the collision is evident. |
||||
|
||||
![]() Wikkyd Member since: 10/25/2002 From: 6667 feet below |
||||
|
|
||||
| Stezka is right. This algorithm will not work. Here is the problem: Figure 10quote: The problem is that the polygon intersection point is not really where the sphere will touch the polygon. If you dont look at these 2d pictures and instead think of this in 3d space you will see what I mean. Its as if the entire algorithm was constructed by just considering these 2d drawings. The polygon intersection point is determined by taking the closest point to the plane intersection point . Yet the sphere still has to travel farther than this (thus going beyond the plane) before it really touches the polygon. Herein lies the fault with this algoritm. Because the polygon intersection point(as defined in this article) is not the REAL polygon intersection point, when you reverse intersect the polygon intersection point to the sphere by inverting the velocity vector, you may flag a collision when in fact there isnt one. A more accurate way to do this that I can think of is to use 3 seperate tests. 1) A sphere to infinite plane collision test and then determining if the point of collision resides within the polygon. 2) A sphere to infinite line collision test and then determining if the point on the line resides within a polygon edge. Do this for all the edges of the polygon. 3) A sphere to vertex collision test. Do this for all three vertices of the polygon. I know this is more checks, but it is the only way I can think to correct this algorithms faults. [edited by - Wikkyd on January 11, 2003 8:13:10 PM] |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| I've been implementing this with directX vectors. I hope to get the code posted here sometime. I found a few errors in the document so far. One, the source point is updated right before the slide plane is constructed. It should be updated after. Two, this line: Double time = intersect(, slidePlaneNormal, slidePlaneOrigin, slidePlaneNormal); If you use his intersect psuedo-code it should be Double time = intersect(slidePlaneOrigin, slidePlaneNormal, destinationPoint, slidePlaneNormal); Three, I don't know what epsilon is, nor have I worked out the geometry behind ellipse intersection. Anyone help me there? Pete Knepley knepleyp at umich dot edu |
||||
|
||||
![]() King_jinjing Member since: 8/3/2002 From: China |
||||
|
|
||||
| I don't know what epsilon is, too. |
||||
|
||||
![]() Dickens Member since: 11/8/2001 From: Hong Kong |
||||
|
|
||||
| I think epsilon is just a value to stop the recursive rounting, as the len of velocity vector is a double value and may not be exactly 0.0f. So if the len of velocity vector is less than epsilon (let's said 0.00001) then the recursive function stop. And I think it may be better to use a for loop instead of recursive function call. [edited by - dickens on April 1, 2004 8:08:17 PM] |
||||
|
||||
![]() tiutiu Member since: 4/2/2002 |
||||
|
|
||||
| in www.peroxide.dk there is the new implementation of the algoritm. I read it all and i sure it'll work. I'm going to start coding my version next week. BTW, is it a good idea to use that algorithm of CD for all the entities? i plan to use it for colliding the dynamic ( != animated) meshes with the scene, discarding triangles with OBBTree vs ellipsoid testing. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Hi! my method is better than this. Look at my code : http://www.cppfrance.com/codes/CAMERA-OPENGL-UTILISANT-QUATERNIONS_36930.aspx |
||||
|
||||
![]() TheC00L1 Member since: 6/1/2006 From: Schenectady, NY, United States |
||||
|
|
||||
Quote: Epsilon is a threshold value that anything less than it is discarded as 0. Like when normalizing a vector, if d<EPSILON then the magnitude of the vector is considered 0. It is used a lot in ray tracing. |
||||
|
||||
![]() Agwan Member since: 10/22/2005 |
||||
|
|
||||
| haha, It works! i have a system i build with the help of the article that seems to be working correctly, built in C#. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|