Animating in RUBE

General discussion about the R.U.B.E editor
Post Reply
gOzaru
Posts: 16
Joined: Wed May 27, 2015 6:33 am

Animating in RUBE

Post by gOzaru »

I had registered my paypal, just wait a few days to purchase RUBE.
What I am asking is can I animate dynamic bodies in RUBE and export it as separate file or it export along with JSON file?
I want to animate the deer which has physic bodies in it.
Is it possible?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Animating in RUBE

Post by iforce2d »

No, RUBE is not animation software, and all control of the scene after loading will depend on your own program. Generally keyframe style animation and physics simulation are not very easy to fit together, since they are in conflict with each other. The two main approaches would be:

- set the positions of the animated bodies explicitly with SetTransform.... this has the disadvantage that the physics simulation is completely ignored, so you might as well not even have a physics engine. You could of course switch to using physics simulation anytime, eg. if the character dies and should become a ragdoll.

- move the animated bodies by using forces, or joint motors.... this has the disadvantage that it's extremely complex to make it happen in a way that looks any good, but it does mean you the bodies will react naturally to collisions etc.

Having said that though, I have used a rudimentary keyframe system for very simple animations a few times, by simply exporting a whole scene for each keyframe position. For example, this robot arm loads some key positions, and then cycles between them by setting each joint motor in the necessary direction, and chekcing when the bodies are close enough to the target position: http://www.iforce2d.net/blog/2011-07-25

This boxer does the same thing, by choosing one of three positions: https://www.youtube.com/watch?v=rbUBAr7S_Wk
And so does the rider in Downhill Supreme: https://www.youtube.com/watch?v=VFCNP7fV3og
gOzaru
Posts: 16
Joined: Wed May 27, 2015 6:33 am

Re: Animating in RUBE

Post by gOzaru »

uhm....
so you mean I can simulate the animation of deer in run time?
I need to move the box2D joint in my program like in ragdoll example?
if that's the case then it is possible to animate deer in cocos2d-x, right?

And I just need to assign the deer's part of images to body and joint them in R.U.B.E.
Then animate them in my program?
If so, how to make deer to loop the ragdoll's movement?

Should I add contact listener when deer's ragdoll collide with my character?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Animating in RUBE

Post by iforce2d »

... I think I already answered, the two main ways you could do it. And as I mentioned, it can be extremely complex.

If you want to do something when the deer and player collide, then yes, you'll need a contact listener.
Post Reply