ODE and graph layouts

1 view
Skip to first unread message

speculatius

unread,
Mar 23, 2008, 10:57:21 AM3/23/08
to ode-users
Hi,

i am working on graph visualization, and i am looking for engine, that
can do physical calculations for me. Concretely, i need simulate
springs and electrical force created by electrical charge. Is there a
way to simulate this electrical forces? Or is there analougue way to
do it using rigid body dynamics (infinite springs...)? Should i use
ODE, or do you know better choice for me?

For more information about what i need, see http://en.wikipedia.org/wiki/Force-based_layout

Thanks

cbianchi

unread,
Mar 24, 2008, 9:13:17 AM3/24/08
to ode-users
Hi
do you need the ode collision detection/response system? do you just
need particles or instead it's important to model rotation/angular
velocity/inertia effects/friction/restitution... e.g. everything
related to rigid bodies dynamics...
if you answer no two both the previous questions, then you probably
don't need ODE. Also, ODE allows you to "add" some forces to the rigid
bodies in the scene, but you need to compute those forces manually
(hook's law, coulomb's law, etc...). So, is it really worth? You can
model your layout particle using a simple euler integrator and compute
the forces you need.
You can start here: http://www.cs.cmu.edu/~baraff/sigcourse/
This is the famous baraff's tutorial on physically based simulations.
It'll give you a nice view on how to model a particle system with
masses and forces.
Hope this helps,
Cristian

speculatius

unread,
Mar 25, 2008, 10:34:09 AM3/25/08
to ode-users
Hi,

thank for response. I tried to do it "manually" and it works fine. But
it is pretty slow. When I have cca 300 bodies and 300 random springs
between them, it takes few minutes to compute equilibrium of this
system. Is it normal? Anyway, it is better that nothing :)

cbianchi

unread,
Mar 25, 2008, 11:49:32 AM3/25/08
to ode-users
Welcome to the world of simulations! :)
It could be normal... or not!
How many iterations does your system need to reach equilibrium?
How much does each iteration cost?
You need to evaluate these two factors to understand where (and if)
it's possible to work for optimizations. If you find out that each
iteration is very expensive, the you can try to optimize it, but on
the other hand, If you find out that the system has lots of problem at
reaching the stability, then you need to work on it!
For example, for this kind of system, a Verlet Integrator could be
suitable. Google for it, there is a nice paper on Gamasutra (sorry I
can't find the link atm).
I think you could get real improvements using it!
Cristian

speculatius

unread,
Mar 30, 2008, 6:11:02 AM3/30/08
to ode-users
Verlet integrator looks better :) And I found one more good stuff. It
is called Barnes-Hut algorithm. Thank...
Mato
Reply all
Reply to author
Forward
0 new messages