Polygon-Polygon Collision Detection

Blitz3D Forums/Blitz3D Programming/Polygon-Polygon Collision Detection

Spot(Posted 2004) [#1]
Would anyone be willing to write a library that could do polygon-polygon collisions with reactions (like the normal blitz ones, stop, sliding, sliding with sliding down hill prevention).
I know many people would appreciate things like this, especially if it was optimized (by using a preliminary ellipsoid to polygon, then going in with the full polygon-polygon if that checks)...

I would do it myself, but unfortunately I have no clue how to do it.

Any takers?


Ross C(Posted 2004) [#2]
Problem with this is i think someone would have done it by now if it were possible (easyish) :S But please prove me wrong :)


Beaker(Posted 2004) [#3]
Polygon to polygon collisions do not provide you with the data you need to do sliding etc. The closest you can get is to do full ragdoll physics which still uses sphere-to-poly collisions. What you probably need is multiple spheres/ellipsoids to roughly describe the shape of moving object.


Spot(Posted 2004) [#4]
I know that the built in blitz polygon to polygon collision system (MeshesIntersect()) does not give very much information.. So, thats why I asked someone to make a library that could ;).

Any idea how I could use multiple ellipsoids to provide collisions for one object (I.E how would I make the object react properly for the collisions).


Zethrax(Posted 2004) [#5]
Check out the link below, which describes how to use verlet physics to do ragdoll animation.

http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm

Also, do some searches for 'verlet' and 'physics' on this forum and the one over at blitzcoder.com. There are quite a few practical verlet ragdoll physics demos that use multiple collision spheres and are written in Blitz kicking about which could be of use to you. I think there may be one or two in the 3d graphics code archives here, too.


-=Darkheart=-(Posted 2004) [#6]
Verlets was done AGES ago:

http://www.blitzbasic.com/codearcs/codearcs.php?code=688

Darkheart


Skitchy(Posted 2004) [#7]
There was a new dll floating around a while ago that adds lots of collision stuff. It was originally done for DarkBasic but they've made a version for Blitz as well. The features sounded REALLY good too. Sorry, I can't remember the name but it was on the forum about a month ago. ;)


(tu) sinu(Posted 2004) [#8]
it was the nuclearglory dll

www.nuclearglory.com


Spot(Posted 2004) [#9]
Hmm, that collision system sounds perfect.. Until you get to the bottom of the page where it states that they use ellipsoid > ellipsoid (or polygon) collision detection.. There isn't any polygon>polygon collision in that either (and in my opinion it doesn't offer anything over regular blitz collisions).

I will check out that vertlet stuff, thanks for the links.


Spot(Posted 2004) [#10]
I hate to sound like an idiot, but I can't find a vertlet system that is relatively simple to use.

I mean, I'm looking for one where I can specify an entity (with a collision sphere) and basically parent (well sort of, parent with collision response affecting both) to another entity.


skidracer(Posted 2004) [#11]
If you use a unique entity type for each compound object it is relatively easy to enumerate per object all collisions that happen to an entity and it's children.

The trick is building in some rigid body code so that each collision affects both inertia and rotational inertia of the entire object, ie your wish for simple sliding is not really relevant for rigid bodys that have non uniform roll.


Spot(Posted 2004) [#12]
Could you elaborate?


Beaker(Posted 2004) [#13]
Spot, you are wrong about the NuclearGlory collision system. It does offer a few (important) things over Blitz collision system.

Also, I would like to know what kind of game you are making that requires such an elaborate collision system, when nearly every game in history doesn't do poly-to-poly collision (including HalfLife 2)?

Verlets are complicated, no two ways about it, but they arent poly-to-poly either.


Spot(Posted 2004) [#14]
Okay, although most games do not use their high detail meshes as collision objects, they have polygon collision detection on their (VERY) low poly collision meshes.


Zethrax(Posted 2004) [#15]
Sweenie's in the process of writing a Blitz wrapper for the Tokamak physics engine at the moment, and it sounds like its pretty close to done. Tokamak includes a variety of collision zone shapes which can be combined to fit over a mesh fairly tightly, or at least I got that impression from the info at their site.

Check out this post for more info.

http://www.blitzbasic.com/Community/posts.php?topic=29381


Sweenie(Posted 2004) [#16]
Tokamak includes a variety of collision zone shapes which can be combined to fit over a mesh fairly tightly


Yes, in Tokamak you create a rigidbody and attach primitives to it to define it's collision volume.
You can attach several primitives to one single body.
Currently three primitives are supported.
Sphere, Box and Cylinder(however, the cylinder ain't really a cylinder but a capsule)

You should be able to setup Tokamak to only supply collisioninfo for you by disabling collisionresponses and use zero gravity. That way no forces are acting on the bodies except external forces triggered by you.
You would have to set the position and orientation of the body.

To make the body collide with static scenery like a terrain you can feed tokamak with the terrains vertices.

Note: The collisioninfo and terrainstuff i'm talking about isn't included in the wrapper yet, but I intend to wrap every function of tokamak.