[ODE] Collision CSG?
Adam Moravanszky [Novodex]
adam.moravanszky at novodex.com
Thu Mar 27 06:27:02 2003
I experimented with this idea recently. Some issues:
* Unless you want to restrict yourself to a cylinder, which is not always
appropriate, finding a general 'base' shape is tricky. One approach is to
use a low resolution reduced version of the original mesh. Then the
algorithm becomes very similar to what the graphics people do to add
automatic detail bumpmaps to progressive mesh reduced versions of their
models. (->some siggraph 2000 papers, new games like Doom3, nVidia melody
tool, etc.) The cylinder only version is similar to the nifty LOD algorithm
that Shiny used in their game 'Messiah'.
* Once you have your data set, unless its cylinder based, you still have to
do a 3D mesh collision detection of sorts to retrive the correct triangle
which has the heightfield /displacement map that you need to collide
against. This is one thing the graphics people don't have to do, and its
not much easier than regular mesh-mesh collisions, other than not having to
generate contacts and having less trigs to work with compared to the
original model. For highly convex / topoligically complex meshes you won't
be able to reduce the base mesh enough to have a real performance gain -- if
you reduce too agressively you will get several 'layers' of mesh mapping to
a single polygon, and that is no longer a heightfield but rather an LDI.
That may also be workable but its definitely more complex.
If you restrict yourself to cylinders the second problem doesn't appear, but
you will find that cylinders are not be expressive enough in general.
I would look into doing this in a game that has the bump map generation
logic in place already that could be extended to handle collision detection.
-- Adam Moravanszky
/*================*\
|Chief Software Architect
|NovodeX AG
|physics middleware
|www.novodex.com
\*================*/
----- Original Message -----
From: <david@csworkbench.com>
To: <ode@q12.org>
Sent: Thursday, March 27, 2003 12:23 PM
Subject: Re: [ODE] Collision CSG?
> Here's an idea that might be interesting to add to the collision toolbox:
> primitive-mapped heightfields. For example, you have a mesh of an arm
> that kinda halfway looks like a capped cylinder but not really. So you
> take a capped cylinder, make a function to map it's surface to 2D (i.e.
> the long axis is x and degrees around it is y). Then you could specify
> heights in terms of 0 = directly on the surface of the primitive, negative
> means that many units towards the center, and positive means that many
> units away from the center (all in body coordinates if I'm clear as mud).
> Nothing would happen until an object collided with the surface of the
> primitive, then the collision system would query the heightfield at that
> x,y coordinate (or you could just do it yourself). This should be a lot
> faster than generic mesh collisions while still being able to define the
> exact same shape in many instances.
>
> Just a thought,
> David
>