I'm trying to simulate a tree my first idea was to use spring/mass system to create soft body of the plant, problem with that approach was how to connect branches together without 1000's of springs
Secound attempt was to build system from rigid bodies , costraints + springs to give elsticity to joints... at the moment I've finished my litle construction,but it becomes unstable when frame rate drops to 40 fps and I haven't yet implemented springs into it...
any sugestions how to simulate complex plant like tree with 4 levels and 100 branches ?
I'm trying to simulate a tree my first idea was to use spring/mass system to create soft body of the plant, problem with that approach was how to connect branches together without 1000's of springs
Secound attempt was to build system from rigid bodies , costraints + springs to give elsticity to joints... at the moment I've finished my litle construction,but it becomes unstable when frame rate drops to 40 fps and I haven't yet implemented springs into it...
any sugestions how to simulate complex plant like tree with 4 levels and 100 branches ?
thx
Hi,
Depend on the quality you want to achieve, stiff springs mean stiff equations and you better try implicit integration.
1000 springs are easily handled by an implicit solver even using time steps on the order of 1/50.
You can use rotational springs instead of simple linear springs for your constraints.
BTW: You say that no springs are included in your simulator, so what you mean by 'it becomes unstable when frame rate drops to 40 fps'?
I've made a small mistake writing point to point constraint connecting branches and it caused constraints to oscillate ... at the moment whole simulation is stable even at 5 fps. I still didn't manage to implement rotational constraint blocking twists at the joint.
I will try to research information on implicit integration any suggestion where to start ?
I've made a small mistake writing point to point constraint connecting branches and it caused constraints to oscillate ... at the moment whole simulation is stable even at 5 fps. I still didn't manage to implement rotational constraint blocking twists at the joint.
I will try to research information on implicit integration any suggestion where to start ?
thanks Janusz Klaptocz
Hi Janusz,
I recommend you read the course paper written by David Baraff:
I would definitely go with a verlet-based integrator coupled with a simple relaxation solver using distance constraints... i.e. jakobsen style physics.
stable and fast, but not that accurate, but a truly accurate model of a tree isn't going to be anywhere near fast enough for real-time.
There was a talk at Game Developer Conference on extending the relaxation solver to handle orientation constraints, but I can't remember it's name. It used interpolations of quaternions.