Author: Dan Ebberts
Creates a realistic drop and bounce effect for a sign or other object hanging by a string or strings.
This excellent tutorial walks you through the process for animating an object hanging by two strings. With some adaptation this expression can also be applied to an object hanging by one string, like a lightbulb).
Hover over the code and click the copy button.
//For Drop Bounce of Object: veloc = 35; amplitude = 30; decay = 1.0; y = amplitude*Math.cos(veloc*time)/Math.exp(decay*time); value + [0, y] //For the Swinging Rotation Effect: veloc = 7; amplitude = 80; decay = .7; amplitude*Math.sin(veloc*time)/Math.exp(decay*time)