Nikos123

How to do a InOutSine ease

Recommended Posts

Hi Again!

Nikos... I have a funny feeling that you don't want ease-in or ease-out at all.  I think you want linear acceleration and deceleration.

http://playground.babylonjs.com/#1HZKPM

hold A or D keys... check out how that acts.  Is that anything like the "feel" you are looking for?

Down in the renderLoop, I am constantly rotating 'rotSpeed' amount.  RotSpeed starts at 0, but the longer you hold the A or D keys... the faster or slower it goes (because rotSpeed is increasing/decreasing its rotational increments). 

Up at the top of the playground... there you can see the A/D keys... adding or subtracting .001 rotSpeed per keypress.  This gives you a linear easing to full speed, and a linear easing to stop.

The thing to remember is that the code in registerBeforeRender is running constantly. 

How's it feel to you?  Is this close to what you are looking-for... as far as easing?  *shrug*

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.