[ODE] Sphere to Cube?

Bram Stolk bram at sara.nl
Tue Sep 12 00:54:14 MST 2006

David Perry wrote:
> Hi.
> I've created a sphere and have it rolling around my world quite happily.
> What I'm wanting to do is read a keypress and convert this sphere to a
> cube (or if it's already been converted to a cube, convert it back to a
> sphere).
> The problem is I want it to have all the attributes that the previous
> shape did ie. mass, rotation, velocity etc.
> Is this even possible? I've tried looking online for an answer but I'm
> not really sure what I should be looking for exactly.

I guess that you could simply associate a new geom with the body, I don't
expect ODE to 'cache' geometric props between time steps.

But it can be dangerous wrt collisions.
If you switch shapes, you are likely to create a deep penetration that
results in very high forces, which make the body jump.

ODE expects you to build an initial world in a non-colliding state,
and then run the simulation.

If you would add some smart mathematics to your application, so that
after a switch, the body is adjusted for intersections, it would 
probably work pretty well.


> Thanks in advance.
> ------------------------------------------------------------------------
> Be one of the first to try Windows Live Mail.
> <http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d>
> ------------------------------------------------------------------------
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

Bram Stolk, VR Engineer SARA, Amsterdam.   tel +31 20 592 3000

"Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit 
 operating system originally coded for a 4-bit microprocessor by a 2-bit 
 company that can't stand 1 bit of competition."

More information about the ODE mailing list