Page 1 of 1

little dancing guy

Posted: Thu Aug 20, 2009 2:56 am
by arri
hi,

i created a character using chipmunk. a human body with a corps, a head, and all the limbs and extensions in place.
using rotaryLimitJoint and dampedRotarySpring i managed to make him stand all by its' self,
although he looks like he's on (too much) amfetamine...

now i'm a bit stuck on how to procede.
my final goal is to make him dance different dances/styles.(and not fall over)
maybe according to a several "choreographies".

one way i'm thinking of is to connect all limbs/joints to (invisible) static bodies, and have all these bodies perform (hardcoded...) animations, so that the character will move the way i want. but that's not at all as easy as it sounds..
also i played around with applying forces or impulses, but that looks very clunky, and it is very hard to keep the movements within moderate ranges.
would anyone here have suggestions on how to solve problem?
the actual dances/choreographies don't matter so much, as long as they look more or less natural/convincing.

and then i also have a weird problem.
when the little guy is standing at ease, he will always slowly and smoothly but consistantly slide to the left in the space.
i've tried everything with regard to surface/friction settings, but nothing that solves this. even applying very strong damping to the space will only slow down the sliding, biut not stop it.
i imagine it has to do with how the body is actually a complex system with springs that maybe have some internal (invisible) resonance that cause this effect.
in which direction could i look for a solution?

many thanks,
arri

Re: little dancing guy

Posted: Thu Aug 20, 2009 11:10 am
by slembcke
To the first part, instead of damped rotary springs to control his movements, I would try using a gear joint with a 1:1 ratio, a force maximum, and then animate the phase parameter of the joint. This will look much less springy and wavy. Beyond that, actually animating him... I have no idea, you are blazing new ground I think.

As to the sideways movement problem. I would also expect that it's because you have a collection of constraints that are all vibrating in such a way as to make him scoot. I've noticed this as a problem sometimes with things that have multiple legs resting on the ground all connected by joints. I think it's not really a bug per say, but an artifact of how the solver works. I'm not really sure how to reduce it either other than increasing the iterations. Disabling elastic iterations is a good place to start.

Re: little dancing guy

Posted: Sun Aug 23, 2009 1:33 pm
by dieterweb
I would try to not animate the character with chipmunk, but use a skeletal animation for him. When he is dead, or falls, turn him into a ragdoll with chipmunk physics.

Re: little dancing guy

Posted: Sun Aug 30, 2009 10:41 am
by arri
thanks for these suggestions,

@slembcke: the gearjoints indeed work much better, i use them with certain force (not max) and bias settings, so that the joints can still be bent by 'external' forces .. also, the gearjoints make it very easy to create certain combinations of movements that are very common, such as lifting a leg, while beding the knee of that leg.. in this case the hip- and the knee-joints should bend with the same amount, but in opposite directions.

dieterweb, i've been thinking of creating a skeleton-model myself to do what you suggest, but due to time constraints i left that idea behind, since the chipmunk-way might not be ideal, but it more/less works for what i want, and is actually pretty easy to implement..
and instead of implementing my own skeleton-model, i've been looking if there maybe are any (opensource) skeleton-model/-animating libraries around, but i haven't found any. are you aware of such a project somewhere?


thanks
arri

Re: little dancing guy

Posted: Sun Aug 30, 2009 11:56 am
by dieterweb
I searched for open libraries, but have not found anything usefull. There is much for 3D, but not 2D. Of couse these can be used for 2D, too, but they where too complex for what I needed.

Here is a good tutorial: http://gpwiki.org/index.php/OpenGL:Tuto ... nes_System

Thomas

Re: little dancing guy

Posted: Tue Sep 22, 2009 8:54 am
by arri
thanks thomas,
yes i also found such libraries, but thei're way over the top for what i want..

anyway, ..for those interested:

the results of my adventures creating a dancing guy using chipmunk
can be checked-out in the iphone-app JeePee, which just entered the appstore.
it's free, very funny (especially for the dutch), and utterly useless!

the app is not gonna make me rich, but i'm sure JeePee will generate
revenue indirectly, and the first place i'll visit will be your donation-button.. :)

thanks a billion!

gr
arri

Re: little dancing guy

Posted: Tue Sep 22, 2009 4:00 pm
by dieterweb
looks really funny. I would add some rotationary constraints to the pivot joints. The ragdoll would not collapse so unnaturally.

Re: little dancing guy

Posted: Tue Sep 22, 2009 5:22 pm
by slembcke
Awww. Requires 3.0. I haven't updated my iPod so that we have a 2.x testing device.