AE ENHANCERS

Expressions/Scripts/Presets
It is currently Fri May 24, 2013 2:54 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Expression for offset and bounce
PostPosted: Fri Oct 21, 2005 12:49 pm 
Offline

Joined: Thu Oct 20, 2005 12:49 pm
Posts: 1
I'm trying to simulate the look of a slot machine. I'm using the offset filter with a strip of images, and it's working well. What I can't get it to do is give me that bounce.

Can anyone point me in the direction of where to begin with an expression to do this? I'm an absolute neophyte when it comes to expressions.

Thanks,
Chris


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 12:04 pm 
Offline

Joined: Fri Aug 12, 2005 8:54 am
Posts: 9
Location: Rochester, NH
I would check Dan Ebberts' amazing expression site Motionscript.com.

After going through the basics of expressions, check out the section on physical simulations:

http://www.motionscript.com/mastering-e ... ics-3.html

Using sine waves and exponential decay, you should be able to build a very decent bounce for your offset effect.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 2:35 pm 
Offline

Joined: Fri Aug 12, 2005 8:54 am
Posts: 9
Location: Rochester, NH
If you need a fast solution, set two keyframes for the spinning motion, and try this expression on the 'shift center to' property of Offset:

freq = 10;
amplitude = 25;
decay = 5.0;

t = time - key(numKeys).time;
x = scale[0] + amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
if (time < key(numKeys).time)
thisProperty else [thisProperty[0], thisProperty[1]+x]

After your last keyframe, there should be a fairly decent decaying bounce. Adjust your freq, amplitude and decay settings as needed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group