www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on August 18, 2008, 09:44:19 am

Title: Any Way to Speed Up an Animation?
Post by: AGP on August 18, 2008, 09:44:19 am
There's not much in the Animation class itself, but is there some way of changing the timing of animations I'm missing?
Title: Re: Any Way to Speed Up an Animation?
Post by: EgonOlsen on August 18, 2008, 09:52:23 am
For keyframe animations? Just use a higher increment for the animation index.
Title: Re: Any Way to Speed Up an Animation?
Post by: AGP on August 18, 2008, 05:36:20 pm
Do you mean the Object3D.animate(int) method? How would that work? I'm actually trying to speed up a skeletal animation, which I'm not sure is possible, but let's go one step at a time. : -)
Title: Re: Any Way to Speed Up an Animation?
Post by: AGP on August 18, 2008, 08:24:37 pm
Egon, sorry. I assumed the Animation instance returned by the SkeletalObject wouldn't be null. Evidently, I assumed wrong and I understand what you meant by the animate(index) now. Cyber's SkeletalAnimation can only be advanced (as far as I could tell) by the advanceAnimation() method, which is really slow. There's no way to re-scale the animation as a whole. Anyway, thanks for the attention yet again.
Title: Re: Any Way to Speed Up an Animation?
Post by: cyberkilla on August 21, 2008, 01:08:28 pm
Egon, sorry. I assumed the Animation instance returned by the SkeletalObject wouldn't be null. Evidently, I assumed wrong and I understand what you meant by the animate(index) now. Cyber's SkeletalAnimation can only be advanced (as far as I could tell) by the advanceAnimation() method, which is really slow. There's no way to re-scale the animation as a whole. Anyway, thanks for the attention yet again.

There is a reason for this, I believe.

The animation is done at the exact pace that it was exported in.
If waving your model's hand takes 5 seconds when you animated it, it will take that long in JPCT.

The more you call advanceAnimation(), the more the interstitial positions are calculated. If you draw at 3 frames per second, it will still take 5 seconds to move the hand, but it will not be as smooth and granular than if you update it at 25 frames per second.
See what I mean?

Now, I'm sure it's possible to speed it up, but why? Just export it at the speed you intended it to be at, and you'll not have this issue:)
Title: Re: Any Way to Speed Up an Animation?
Post by: Disastorm on August 23, 2008, 07:28:23 pm
Where is the advanceAnimation method?  I've been using the animate(float index, int seq)  method for my animations, which u can speed up or slow down depending on the value of the float index.
Title: Re: Any Way to Speed Up an Animation?
Post by: cyberkilla on August 25, 2008, 02:31:35 pm
Where is the advanceAnimation method?  I've been using the animate(float index, int seq)  method for my animations, which u can speed up or slow down depending on the value of the float index.

He's talking about the experimental skeletal animation classes I made.