Last active
March 7, 2018 02:41
-
-
Save ryanbru0803/0cb7debe03af07cbcebd979bd844785e to your computer and use it in GitHub Desktop.
This expression will move a vertical bar back and forth across the screen randomly. Create a thin, rectangular solid. Apply the following expression to the position property. tMin and tMax are the minimum and maximum time it takes for the line to mak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This expression will move a vertical bar back and forth across the screen randomly. | |
| Create a thin, rectangular solid. Apply the following expression to the position property. | |
| tMin and tMax are the minimum and maximum time it takes for the line to make one movement. | |
| Adjust them to your needs. | |
| Duplicate the solid a bunch of times to generate a lot of motion. */ | |
| tMin = .5; //minimum segment duration | |
| tMax = 2; //maximum segment duration | |
| end = 0; | |
| j = 0; | |
| while (time >= end){ | |
| j++; | |
| seedRandom(j,true); | |
| start = end; | |
| end += random(tMin,tMax); | |
| } | |
| endVal = random(thisComp.width); | |
| seedRandom(j - 1,true); | |
| x = random(); //this is a throw-away value | |
| startVal = random()*this_comp.width; | |
| x = ease(time,start,end,startVal,endVal); | |
| [x,value[1]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment