Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Modify spiral expression to create a Spring

  • Modify spiral expression to create a Spring

    Posted by Eugene Constable on March 13, 2014 at 12:30 pm

    Hi.
    I am creating an animation that looks at mattress construction, specifically bed springs.
    I need to show a side view of a single spring that shows it growing from bottom to top.

    I have had some success using this expression which I found and applied to a light emmiter and particular:

    radius = 140;
    angle=time*150;
    x=radius*Math.cos(degreesToRadians(angle));
    y=radius*Math.sin(degreesToRadians(angle));
    z=time*70
    center=[640,360,0]
    add(center,[x,y,z]);

    however, I’m not an expressions expert. my spring needs to start with a flat coil then grow then end with a flat coil, it also needs to be ever so slighlty barrel shaped. I’m sure this is achievable by altering the spiral expression and perhaps attaching sliders to the angle and radius, but I cant get it to work!

    see pics to aid explanation:

    The white areas I have drawn sort of describe how i need the ends tof the spring to look: (arrows to show where the spring needs to be slightly wider radius)

    Any ideas on how I might modify this expression, or much easier workarounds to create this spring, very welcome,

    Thanks in adv,

    Eugene

    Xavier Gomez replied 12 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Xavier Gomez

    March 13, 2014 at 1:39 pm

    The easiest way is to link the radius and z variables to sliders and keyframe those.
    In the graph editor give the radius and z curve the shapes you want.
    With expression it would be more complicated and hard to tweak.

    Xavier.

  • Eugene Constable

    March 13, 2014 at 9:24 pm

    Xavier, many thanks for your response, much appreciated – its kind of what i thought but i’ll have another go, if I get stuck (not unlikely!) i’ll post again. Would I add the sliders to an adjustment layer?

    Cheers,

    Eugene

  • Xavier Gomez

    March 14, 2014 at 9:26 am

    Usually controlling sliders are on null objects but adjustment layer are fine too.

    I just made a try to check that what i had suggested could produce something correct and obtained this (see screenshots). I used your expression, linked z and radius to sliders, but also changed the angle rate to 1000 to get more loops and for that also had to set the particular > emitter > position subframe parameter to 10x(linear). Quite far from your picture but well… the principle is there;)

    Xavier

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy