5 Replies Latest reply on Dec 18, 2008 9:16 PM by A. Cobb

# Scripting a ripple motion for 3D planes

I'm creating a sea of 3Dplanes. thy will stretch off into the horizon in my AE comp.

Is there a script that I can apply to each plane to make it react to the Y position of the other planes? So that if I move one up, the ones around it "ripple" around it as they react to its position? Elastically?

Not sure if this is easy or hard, just thought I'd ask.

Thanks

---------S
• ###### 1. Re: Scripting a ripple motion for 3D planes
You can do this with expressions. It's a little too complex for me to do from my head. If I get a chance I'll work it out and post an example.
• ###### 2. Re: Scripting a ripple motion for 3D planes
Check Dan Ebberts "Follow the leader" stuff on http://www.motionscript.com. It's more or less the same principle - make the other layers react with a delay to a master layer. For a circular motion and falloff, Math.sin() and Math.cos() are your friends. Falloff is merely a distance based multiplier, either linear or with whatever formula you desire. Depending on what you do, you could of course simply feed in the time as the driving parameter for your sine waves.... Apart from that: Why not simply use Card Dance? It responds to the comp camera and can made to produce any pattern by respective driver maps...

Mylenium
• ###### 3. Re: Scripting a ripple motion for 3D planes
Great ideas, both of you. Thanks.

I'll try card dance first, then I'll try expressions if I'm having trouble.

I need to learn expressions. Coding has always been my weak point.

Thanks all,

----------S
• ###### 4. Re: Scripting a ripple motion for 3D planes
Also look at Trapcode Echospace:

http://www.trapcode.com/products_echospace.html

Red Giant Software
• ###### 5. Re: Scripting a ripple motion for 3D planes
If EchoSpace doesn't meet your needs, this can be done using Wave World and expressions. The idea is to use a single solid with Wave World (or a similar effect or piece of footage) as a displacement map to drive the displacement of the layers (I'll call it "Displacement Map"). Position the displacement map such that it encompasses the layers you want to displace, and parent those layers to the Displacement Map layer. Apply the Slider Control effect to the Displacement Map layer, and rename it "Displacement height". Set this slider control to some nonzero number (this will be the max/min height of the displacement relative to the Displacement Map layer). Then apply the following expression to each of the layers to be displaced:

>factor = parent.effect("Displacement height")("Slider");

>sample = parent.sampleImage([position[0], position[1]], radius = [.5, .5], postEffect = true, t = time);

>displacement = linear((sample[0]+sample[1]+sample[2])/3, -factor/2, factor);

>transform.position+[0, 0, displacement]

With lots of layers to be displaced, it won't render fast, but it should do what you want and should be very easy to control.