Home » Community » Forums » » General Collision Detection for Games Using Ellipsoids
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

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



 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Very good document on it at...

http://www.peroxide.dk/tutorials/tut10/pxdtut10.html

 User Rating: 1026   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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


 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.


 User Rating: 1015    Report this Post to a Moderator | Link

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.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Stezka is right. This algorithm will not work.

Here is the problem:

Figure 10

quote:
Figure 10 shows two cases in which the polygon intersection point is used for reverse intersection to locate the point at which a collision with the sphere occurs. Note that in figure 10 (right) this point is the same point as the sphere intersection point; yet figure 10 (left) it is not.




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]

 User Rating: 1012   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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

 User Rating: 1015    Report this Post to a Moderator | Link

I don't know what epsilon is, too.

 User Rating: 1034   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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]

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Hi! my method is better than this. Look at my code :
http://www.cppfrance.com/codes/CAMERA-OPENGL-UTILISANT-QUATERNIONS_36930.aspx


 User Rating: 1015    Report this Post to a Moderator | Link

Quote:
I don't know what epsilon is,


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.

 User Rating: 920   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

haha, It works!

i have a system i build with the help of the article that seems to be working correctly, built in C#.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: