Which constraint type to use to simulate a bending stem?

Official forum for the Chipmunk2D Physics Library.
Post Reply
jamesw
Posts: 1
Joined: Sun Feb 13, 2011 3:18 pm
Contact:

Which constraint type to use to simulate a bending stem?

Post by jamesw »

Hi guys!

I'm still fairly new to Chipmunk. Can someone give me some insight on which constraint / joint type would be best to use when simulating a bending flower stem under a certain wind condition?

Thanks!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Which constraint type to use to simulate a bending stem?

Post by slembcke »

Ooof. I tried this recently. I contracted on a book (due to be out any day now) with Atomic Antelope recently that had a flexible plant stem in one of the scenes. It was much harder to get it stable than I expected.

Basically it was a bunch of bodies with pivot joints holding them together. To get the "flex" I added damped rotary springs with extremely high spring values. To compensate for the extreme forces causing the numerical precision to explode, I had to make the moment of inertia of the plant segments to be about 50x higher than would be correct (though it wasn't noticeable at all). I did get it to work quite well after a few hours of tweaking, but it wasn't very easy. Quite often the stem would bend a little, then all the pieces would go flying apart. The scene had 90 joints/constraints in it by the time I was done.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
hm50
Posts: 5
Joined: Wed Mar 16, 2011 9:24 am
Contact:

Re: Which constraint type to use to simulate a bending stem?

Post by hm50 »

I did a simple "bending" flower by attaching the flower rect to ground body with a pin and then attaching damped springs at the top of the flower at 45 deg back to the ground body. looks ok for small flowers.
~~Support Indie Devs~~
[url]http://www.2BPMSoftware.com[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests