Physics simulation

Community Forums/Showcase/Physics simulation

Sweenie(Posted 2005) [#1]
I just made a small physicssimulation based on the paper 'Meshless Deformations Based on Shape Matching", by ummhh, some smart guys.
(One of them works at Novodex/AGEIA)

It's similar to the verlet method except that the particles are constrained to their original position.
Read the paper for further details(or simply just a better explanation)

I just got it working, so the bodies are only rigid for now.
I do plan to get the full algorithm working so that the bodies can be bent and twisted.(It's awesome)

Here it is..(including the bmax sourcecode)
http://www.svenberra.net/rb_demo.zip


puki(Posted 2005) [#2]
Nice one "Sweenie Toddler".


Neuro(Posted 2005) [#3]
Prety cool...but a lot of code!


Sweenie(Posted 2005) [#4]
Yes, it's currently quite a bit of code.
But half of it aren't used and the algorithm part of the code could probably(most definitely) be optimized and reduced in size.
And notice that the code is actually doing 3D-calculations.
I just skip the Z-axis for this demo.
I intend to make a 3D-demo as well.


Braincell(Posted 2005) [#5]
3D ? As in you could have meshes colliding, or only lines in 3d space?

If it's meshes, that would be exciting.


Sweenie(Posted 2005) [#6]
Yes, you could have meshes colliding.
But my current collisionroutine is just a very simple routine that only checks if any of the points are outside their bounding box environment and reverse a point's velocity if it is.

To get proper collisionhandling you'll have to detect interpenetration between the points(triangle or edge connecting them) and apply proper force to the involved points(the points connected to the edge or triangle on which a penetration occured)
I guess the method described in Jakobsen's paper could work.

But currently I will focus on the deforming part of the simulation since this is where this method stands out.
Using it only for rigid body simulation would be pretty useless since there are more specialized methods/engines for doing that.


Bot Builder(Posted 2005) [#7]
Awesomeness sweenie. The article is really good. Infact, I think I'll be implementing this rather than verlet in my .net 2d game engine.

I actually had the idea for shape matching before. Just not in exactly the same way. It required 3 physical pivot points which made it pretty unstable overall. I also thought of doing it without the pivot points, but i was imagining making this an instant lock for rigid bodies, and it seemed like it would develop instabilities, because i was still applying this into a framework of constraints.