How to use custom Easing function?

Has anyone successfully made a custom easing function and wouldn’t mind sharing an example? The relevant documentation isn’t working with Babylon 4, but I’m not sure if it’s just a syntax problem (I’m not 100% sure exactly what the little FunnyEase snippet is doing) or genuinely isn’t valid in Babylon 4.
Any help is appreciated. Thanks!

Specifically, I’m trying to use Perlin Noise for a camera shake animation, and it seems to make most sense to make a custom easing function for that. Open to other approaches though.

Ease function are used to do the interpolation between animation keyframes.
For screenshake, you can create an animation with random offsets and apply it to the camera. No need for ease in that case.

Not sure I follow you here:) It works well for me: Babylon.js Playground

Hi guys. Just for fun, I thought I would attempt a “bouncy camera” animation (arc-cam target… y-axis only, so far). No keyframe animation, here. I’m letting my favorite band play it… Looper and The Cosines. :slight_smile:

https://www.babylonjs-playground.com/#24SBV7#23

Click on canvas. Ya can’t start another animation until first is finished. (yawn). This is a “diminishing” bounce… like what might happen when your space station is hit by a photon torpedo. :slight_smile: It has a serious drawback… not putting camera .target.y and/or .beta at same position when the anim started. It will be somewhat different… but that’s what a strong torpedo hit might do, too.

The chances of this animation… running at the same speed… on all devices… I dunno about that. Generally speaking… mix Wingnut and math, and ya better have BJS catastrophic scene-explosion insurance. heh.

Yeah, I know. Camera.target is not the same as camera.beta, but, I was lazy. :smiley: At least I didn’t poke random small values at canvas.style.marginTop/marginLeft… which would have been SERIOUSLY lazy. :slight_smile:

Ok, fine, here’s the same bounce… but ALSO happening on camera.beta… which, for an arcCam… can be loosely-considered as its y-position. https://www.babylonjs-playground.com/#24SBV7#24