Bonzai Engine Forum
Bonzai Engine & Tools => Bonzai Engine on Android => Topic started by: amirr on June 04, 2013, 04:57:18 PM
-
I used the AnimationSplitInfo class but it didn't work
Here's the initialization for AnimationSplitInfo
and this function return "0" and so i can't change the animation.
So any advice ?
-
For skeletal animation (as specified in javadoc), works as expected.
Md2 have morph animation and obviously there isn't any skeleton to split.
-
So in MD2 and using morph animation, How to animate a certain number of frames and after awhile play another number of frames ?
-
For morph animation, it's straightfoward:
Create a new Animation object and set the name, start, end, speed fields as wanted. Add the animation to the model using addAnimation. You can now play that animation when you want.
When it's complete, you can play any other Animation.
You can do all of that in the viewer from the animation tab of the model panel. There's a popup in the animation list to add/remove anims.
-
I did what you had said and I've a problem.
Here's the animation sample:
- if i set "start" greater than 0 it didn't animate.
- is "start" and "end" for frames ? because if i set specific frames at start and end it ignores the values and repeat all the frames.
- whatever the value i set for "loop" it didn't loop
- what the unit for "speed" and "loopDuration" ?
-
Start/end/loop/loopDuration units is seconds. Start/end/loop are times in the morph animation keyframe, whereas loopDuration is a duration. Speed has no unit and scale the time to play faster or slower the animation.
Start/end being the time of the first/last frame of the animation. Speed is by default 1 to play at regular speed. Loop is the loop time, the animation is rewinded to that time when it reaches end. Loop is enabled when the value is in the range [start;end[. LoopDuration is by default 0 to instantly go from end to loop, specify a duration in seconds to have a smooth interpolation between them (if needed).
You can take as reference the values from the default animation of your model, and adjust the start/end values for your new animation.