Create Procedurally Animated Rhythmic Dancing Marbles
Tutorial Details
- Requirements: After Effects and Trapcode Lux
- Difficulty: Advanced
- Run Time: 48:16 min
- Difficulty: Advanced
Final Product What You'll Be Creating
Twice a month we revisit some of our reader’s favorite posts from back in the archives of Aetuts+. Today we’ll look at a great post from Satya Meka. This tutorial was published in July 2009.
By now you should expect nothing less than amazing procedural animations from Satya and this tutorial is no exception. Inspired by this piece by Eamae Mirkin which was originally created using the processing programming language, Satya explains the required math background and shows you how to replicate this beautiful animation in After Effects.
Tutorial
Download Tutorial .flv
File size 252MB

Thanks Satya Meka iam downloading the tutorial it seems to be good and I already have this Trapcode lux THXX
Wow! Thank you!
Cool effect. But a bit too long don’t you think? Would’ve been cool to get some 3D camera movements up close to the marbles.
That would be great. Why don’t you give it a try? That is the great thing about tutorials….they should be stimulating your own creativity.
Looks great! Definitely going to give this a try!
I love the outcome!
even an iphone preview, great thanks!
Awesome..
:)
Hay,
Chaithnya,
I am suman maharana from odisha (Bhubaneswar), i see u r work in aetuts but which softwere use in your work…..
Very nice, I like it a lot. Looks slightly wrong when the dots have to suddenly move quickly to cover a larger distance to keep with the timing though.
FINE
NIce “render” ^^ Thanks !!
looks very cool….and different.
cool thanks, shouldn’t this be on the tutorials section though, its currently under articles
Thanks for catching that. Corrected.
Wow.. I know people are saying it was a bit long, but I watched the whole thing. It has hypnotizing. Good job
yea its very hypnotic, im going to try and put in some typography with it
DUDE! That is sweet! Keep it up! :D
Great animation thanks :)
Satya! Nicely done. Nicely done indeed! Thank you.
It’s not a wrong thing but, Satya, could you try to speak a little bit more Louder and try to put the things you explain together, not speak about one thing and another and speak again about the first because it get hard to follow you ^^ maybe write the tutorial before film it ?!
(excuse my crappy langage :x )
Hey Raoul,
I guess that’s because I initially recorded the tutorial, but later on I found some parts needed more explanation. So I inserted some parts later on, which probably caused a little disruption. But from next time, I will make sure to add a proper index.
Nice effect but it’s really too long because nothing happen but bouncing balls for about two minutes. It becomes boring soon, 30 seconds were enough.
A tutorial is not intended for you to produce an identical render and then slap on to your demo reel. If Satya wants to render two minutes, good on him. You should render as much or as little as you want, and then trash the file and keep the knowledge for your own projects.
I’ll add that the two minutes of video shown above should illustrate to you the power and benefits of procedural animation — on which the tutorial provides a great deal of knowledge.
don’t be “shocked” i had the same “problem” with my students ^^
sweet bro.. very cool.. I think some 3d camera movement would have made it even greater but it now we can experiment with the camera movement..but kudos bro..look forward to more tutorials..
Song name?
Haha…awesome!
Since you have to separate values of the position setting at the very start of the tutorial, it appears that this tutorial will be only for those with CS4…..is this correct? Because the Math.sin(time)*100 expression does not work on the position value in CS3.
This should work in CS3:
x= value[0];
y=Math.sin(time)*100;
z= value[2];
[x,y,z]
Thanks Lloyd.
Hey Billy,
You can use the preset Separate XYZ Position in CS3 to get separate position values.
Satya….thanks. I have used that before but completely forgot it was there! I’m still watching your tutorial and enjoying it. Your stuff is always educational regardless.
Just an FYI for those working in CS3….at least for me…..the Separate XYZ position cannot be applied to the light. I had to use Lloyd’s expression above and place Satya’s expression on the Y value. The Separate XYZ worked fine on the solid that Satya was working on during the first 20 minutes but it did not take to the light.
Great Point. I forgot that expression controllers can’t be applied on a light.
CORRECTION! Using Lloyd’s expression does not work. The light ball bounces until I get to the point where I subtract the y position value of the base. The ball then bounces but actually seems to be behind the floor and actually disappears when it bounces. Not working….very frustrated!!!!
Techincally it should work. Do you think you can email the project so that I can look into it further?
Satya….just sent you an email to the guts@gutsblow.com address. If you have time to look it over, great, if not, I understand. Thanks.
Currently, you have the lux layer in the bottom of the comp. Just move your base layer to the bottom of the comp and that solves the problem.
it really is a nice effect, and it would be really interesting to know how this works.
but your voice and your smacking is soooo annoying, that i cant stand it more than 5 minutes.
and you dont get a step forward you are wasting time with unimportant stuff!
Whoa, rude boy. Maybe it’s a good thing to be thankful sometimes? I’m always amazed by people, who are ignorant enough to criticize the voice or other irrelevant stuff. People, you get FREE tuts for you, great know-hows, but oh no, now you DEMAND prof. narrator, greater entertainment and so on… You are annoyed by something like voice? You couldn’t stand it for more then 5 minutes? Well, I guess, keep going then, don’t let the door hit you on the way out.
it’s awesome, that these tutorials are free. and i really think, that he is a great visual fx artist. and i never demanded a perfect narrator.
i watched a tutorial from him, and he kept klicking all around, doing nothing, not even finishing his sentences for like 15min.
freedom of speech 4tw!!!
Broez:
Wow buddy people like you amaze me. How could you say something likes this to someone that has a huge influence in the after effects community. The whole AEtuts site has helped me learn so much about after effects. I copied these tutorials with no issues what so ever and got comfortable with advanced plugins with there help. Im now beginning to design some wicked animations and its because people like Satya that take time out of there life to do these tutorials for FREE!!!!! Have some respect man, I agree freedom of speech but what you said was plan rude and disrespectful. Grow Up…..
Nice one!
Whats the name of the song by the way?
Its “In my Heart” by Moby . You usually find it using by Nokia for a number of their products.
Thanks. Very Sweety :D
This is a brilliant tutorial but like some I’m on CS3 and I’ve only just started using expressions in the last day or so. I haven’t a clue how to get Lloyd’s or Satya’s methods working. All I’m staring at is an expression window saying “transform.position” and any attempt to change that results in AE throwing a hissy fit at me.
Please lend help to the stupid, it’s the only way we’ll learn.
Hey Luche,
I suggest you to create a new Null Object make it 3D and parent the light to the Null Object. The Apply the preset “Separate XYZ Positions” to the Null Object. Then you get individual X,Y and Z positions Then follow the tutorial and apply the expressions as per the tut. But remember, when you duplicate the light, you mush have a different null object too. Otherwise both the lights have similar position values.
If you are a newbie to expressions, instead of trying to follow this tutorial, I recommend you to follow beginner tutorials which basically introduce expressions.
Ok update from the last post. I got it working all the way up to putting in the randomising X axis code. If I add anything to the X axis following Lloyd’s method above then AE just kicks it out.
I do have a rather pretty blue bouncing light though so it’s not all bad.
Satya,
I’m having the same problem. I deleted the “value[0]” that Lloyd put in his expression and kept coming up with an error. I put that back in and put your expression after it and the expression took….however, it didn’t do anything. The ball keeps bouncing up and down.
Can anyone post a screen shot?
Satya….gave up trying with Lloyd’s method and tried your suggestion with the Null. It works fine until you try to sync the waves with the bouncing points. Any idea what expression those of us that are using this method should use for the producer point of the wave layer?
fromWorld(thisComp.layer(“Light 1″).transform.position);
just replace the “Light 1″ with the layer you want like “Null 1″ or “Light 2″ etc.,
Doesn’t work. I tried this expression before I posted earlier. I have tried using the light and the Null….nothing is working…..frustrated!!!
Just send me the project and note that it takes time to get used to expressions.
I have the same problem. I parented the light to a null and every thing works except for the wave synchronization. I used your expression but it doesn’t work, the waves move around but not to the right spot.
Could you post the expressions please
For people who want the expressions,The following code should be applied on the light in both CS3/CS4. Make sure to replace the base value according to your comp base layer.
base = 500; //replace this with the y-position of the base layer
t = Math.floor(time/0.5);
seedRandom(t*0.5,true);
a = random(800);
seedRandom((t+1)*0.5,true);
b = random(800);
x = linear(time,t*0.5,(t+1)*0.5,a,b);
seedRandom(index*t*0.5,true);
c = random(800);
seedRandom(index*(t+1)*0.5,true);
d = random(800);
z = linear(time,t*0.5,(t+1)*0.5,c,d);
y = base-Math.abs(Math.sin((Math.PI/0.5)*time))*300;
[x,y,z];
Thanks a bunch Satya, that code works perfectly.
I can now carry on with your video and follow what you just told me to do.
*edit* Completed the tutorial with flying (and bouncing) colours.
Thanks Satya!
Really clever way of getting around the “new values every frame” aspect of AE expressions that is both useful sometimes and annoying others.
Stupid sentence fragment. :) x2
This lesson wonderful
thank you
This is truely helpful! Thank you all!
This was a BRILLIANT tutorial…I just thought that there is a lot of proscrastination in the tutorial, I am sure it helped a lot of Math noobs (lol), but I really had to skip to minute 5 until the tutorial began. Whataver, it was a great tutorial, very hard concept and I learned it, thanks.
all this talk about Pi has made me hungry for some pie.
cool tutorial, thanks.
for added effect you can use the lights as particle emitters in particular. with a really low opacity, low velocity and short life span it would make a nice little trail behind the balls.
Brilliant tutorial and easy to follow as my first steps in AE, but the render qeue takes up to 3hrs and increases up to 15hrs as time progresses for a 5min clip of this, any solutions?
Try Opengl Renderer in the render settings. That speeds it a lot!
Broez: I have to agree with you. I am glad I can learn from these tutorials but I was getting frustrated cause I could not follow him. So I just had to copy the expression at the end of the tutorial cause nothing else was making sense.. way to speak your mind. I hate suck ups..
Thanks for the tutorial again.. very good.. I think it looks sweet…
Hi to everybody…sorry for my english first!
Satya thanks a lot for this tutorial…and for all you ‘ve made!!!i’ve made it in AE7 with the light position connected to the Null position and separate the null position and so on…i’ve a question…there is a way to make the lights interact with a sort of collision event?
Thanks to AE Tuts + and to all of you GENIUS that shares your knowledge to people in the net…
Roberto
Toing toing toing! It’s funny!
Good effect!
Congratulation again Satya. Another interesting Tut.
Maybe you can help. I just can´t match the waves producer point whith the actual rebound place. What can be wrong? I struggled and followed your tut completly. No matter what changes I introduce, the ball and the ring do not match.
By the way, ignore BroeZ´s comments he is just a child.
Thank you in advance.
If anyone has any problems just email me the project and I will help you.
At the end of the tutorial, you said you added a counter wiggle? show me
I didn’t add any counter wiggle. I mapped the audio amplitude to the light intensity.
what do you think?
http://www.youtube.com/watch?v=YAB8lbR_ZXw
thanks nice tutorial
2*Math.PI/2=Math.Pi
I think it’s more simple…
Hmm i think about to create this effect in Particular. The plugin have a bounce function in it. And in my opinion it could be better synced with soundkeys.
I try it.
btw. great tutorial !!
Great stuff, congratulations.
I like to create things by using math. My problem is, I am new to java script but is very similar to action script. So I hope there will follow some more tutorials using expressions. May be a one about the essiantials in syntax and commands would be good. The rest comes up by using own brain.
By the way, think you said in the beginning, you will show, how to create the lights without trapcode lux in the end – but in my mind your time was running out . Can you give here a short explaination. Have a solution in my head, will check it tomorrow, but i also interested in your way.
Greats from Germany
Hey Robert,
Yes I couldn’t squeeze in the alternative bcoz of time limitations, but the easiest way to do it is using CC sphere with a small radius and add a nice glow with high intensity and radius and absolute parenting it to the light with expressions.
AE expressions are little bit different from actionscript because the expressions are executed on a frame by frame basis unlike actionscript where data can be passed along time. An amazing resource to start with expressions is Dan Ebberts motionscript.com where he explains the basics along with the differences from actionscript.
Thanks a lot, CC spehre was also my idea.
Hello, I from Bogota – Colombia, very very nice, tank you, and tank you …
where did you find the music that you used for this video…
great tutorial!
Fantastic tutorial Satya!
yow this tuts make me feel bad I skipped Math classes in high school.Now I feel like after effect is not for me. :(
Brillant work though.
Very nice
Hi Satya,
found time to try your tutorial out, worked in a great way. Have done a littel finetune in your expression code, so you have full controll.
Added a slidercontrol layer for “velocity”(timemultiplier) and the other random parameters
This for the Y Axis:
v = thisComp.layer(“light 1 bouncing”).effect(“VELOCITY”)(“slider”);
h = thisComp.layer(“light 1 bouncing”).effect(“AMPLITUDE y”)(“slider”)
380-Math.abs(Math.sin((2*Math.PI/v)*time))*h;
This is for the X Axis, Z Axis is analog to that.
v = thisComp.layer(“light 1 bouncing”).effect(“VELOCITY”)(“Slider”);
t = Math.floor(time/v);
f = thisComp.layer(“light 1 bouncing”).effect(“AMPLITUDE x”)(“Slider”);
seedRandom(t*v,true);
a = random(f);
seedRandom((t+1)*v,true);
b = random(f);
linear(time,t*v,(t+1)*v,a,b);
Got little problem to bring the frequency of the wave-emitting in relation of the bounce velocity.
For a bounce frequency of 0.5 and wavefreq. 2 it works fine. But if I want to slower the bouncespeed, i want also to stop the waveemitting until the lights hits the ground again.
Thought, an expression for check the position of the Light should solved this. Like if light position is 380 (my current groundposition) then wavefreq is 2 otherwise 0. But it don`t will work. I’am sure I have the wrong syntax in my code. Or my thinking is wrong. Can you give me an advise for this?
Thanks Robert
Hey Robert,
For the waves to match with the light bounce, the frequency of the bounce should be equal to the freq of the waves. That means, according to your expression controls, frequency is always equal to 1/v, where v is the velocity as per your code. So, technically it should work, even if you are animating the velocity slider. Let me know if this works.
This work, but in another kind. The waves are built without a break. Mean, the light hits the ground and bounce back maybe for 5 seconds, if you use a very slow velocity. In this 5 seconds I want to stop the wave building process.
If the freg of waves = velocityfreg to many waves will be produced and this looks not so smart
Ok, I saw your expressions and your y value isn’t right. Currently you have “380-Math.abs(Math.sin((2*Math.PI/v)*time))*h;”. But we calc the bounce based on half of the wave. So correct it to “380-Math.abs(Math.sin((Math.PI/v)*time))*h;”.
Also I dont think you are getting my point with the frequency of waves. If your light takes 5 seconds to bounce then frequency of waves should be 1/5 which is equal to 0.2
So, the more time the light takes to bounce/slower the bounce the less the freq should be. For 10 sec it should be 0.1
Also make sure the lifespan of the wave is less to make sure your waves dont get cluttered. Let me know if this solves the issue.
If you have any further issues email me.