Jump to content

[solved]change speedRatio


mecanicus
 Share

Recommended Posts

Hi Mec.  That is a very good question.  Not sure if possible.

I play:  http://www.babylonjs-playground.com/#7ZDKA0#3

In line 97, I pause the animation upon slider-change, then set new .speedRatio value, then activate 1.5 sec timer (line 102), then un-pause.

Still, when un-paused after 1.5 secs... mesh "jumps" to new position.  hmm.  Darn.

BJS Animations of THIS type... are 2-step.  #1 - calculated and created, #2 - runned.  Changing values "live" (real time) is difficult, because animation is already calculated and created.  It's "interpolation" has already been "derived" or "grown".  (That's how I understand it, but I am wrong quite often)  :)

(Fellow helpers:  Mec wants speedRatio change without mesh-jumping.  Mec wants a nice, smooth animation speed control.)

Sorry that I have no solution, yet.  I'll keep thinking and testing.  Others will likely have more ideas and will comment soon.

Link to comment
Share on other sites

Thank's Wingnut  for your idea

my solution is :

slider.onValueChangedObservable.add(function() {
                                anim.pause();
                                anim.speedRatio = slider.value;

                        });

And after 

 slider.onPointerUpObservable.add(function() {
                                anim.restart();                           
                        });

the stop time is reduced 

Then the jump is a minor inconvenience for my project

http://www.babylonjs-playground.com/#ZK9Q08

 

Thank's for your answers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...