Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Jeff Mcbride on July 17, 2007 at 4:51 pm

    I’m trying to create a centipede in AE. I’ve created 12 body ovals which move at a constant rate on a mask path. Each body section has two legs, each with three sections. It’s set up so that as the inner leg rotates 1 degree, the middle leg rotates 4 degrees, and the outer leg rotates 4 degrees on top of that.

    The difficulty I knew I’d run into is keeping the tip of the last leg in the same place no matter the position or rotation of its corresponding body part. On top of that, the legs should never cross each other (which is the case on a concave turn in the path)

    Thanks for the help!

    Adrián Wulfrath replied 10 years ago 3 Members · 14 Replies
  • 14 Replies
  • Filip Vandueren

    July 17, 2007 at 10:54 pm

    working on it,
    interesting problem.

    I’ll keep you posted.

    Filip

  • Filip Vandueren

    July 21, 2007 at 10:09 pm

    MMKay..

    it was a bit of a challenge, nearly there.

    The basics of this is just a ‘follow-the leader’ snake: a lot of layers all using the same animation, but a bit later, so you get a train. Add an auto-orient and you’re half way there…

    But you need legs 😉

    SInce you wanted the feet to step and move realisticly the only option would have been IK? but that’s unpractical with so many legs.

    So I decided to use a ‘prebent’ leg, just an arced path with the anchorpoint at one end.
    That I would scale:

    scale 100,100 : a leg bent upwards
    scale 100-100: a leg bent downwards
    scale 100,0 : a leg that’s staright.

    I decided to use AE CS3’s shape layers, so I hope you have the latest version of AE.
    Normally a layer with scale of 0 would have no depth, so the leg would disappear, but using shape layers: I could scale the shape of a path, and stroke it AFTER the scale: so the width of the stroke is not scaled.

    So I created a Shape layer comprising a ‘body-cel’ a right leg and a left leg.
    On the same layer, I created two pointcontrol-effects that calculate positions where the leg could possible be while the body moves: basically just 50 pixels to the left and 50 pixels to the right of the path the body follows.

    Now to have the feet move, the points should not just follow the path in realtime, but actually ‘step’:
    move to their position, stay there for a while, move to the next position.
    That’s fixed inside the expression with a linear function:

    t= Math.floor(time) + linear(time%1, 0.25, 0.75, 0,1);
    toComp(anchorPoint-[0,50], t);

    Okay, now the leg-paths inside the shape layer get an expression that calculate their scale so they extend from their anchorpoint to these calculated points. Luckily enough because of the way this is set up, it’s just a matter of doing a layer-space transformation.

    a=fromComp(effect(“L target”)(“Point”));
    [a[1] * .25 , a[0] * -1.25]

    The mulitplications are there to convert the pixelvalue of position to a scale that works for the dimensions of my leg path (I drew it quite large at 400x80px)

    Anyway, all this is repeated for the right leg.

    The position has this expression:

    s=speed;
    i=index-1
    s==0 ? t=time : t=time-i*(25/s);
    valueAtTime(t)

    meaning: every copy of this layer offsets the animation by a certain time. that time depends on the index of the layer, and the speed at which it’s moving. My bodycell was 25pixels high: so I want the copies to never be further than 25 pixels apart: if i would just delay every next layer a certain amount of frames, it would depend on the speed at which it moves… yada yada yada
    + There’s some extra code in there to prevent divide by zero.

    Then I watched some films on youtube and saw that centipedes of course don’t move all their legs at the same time. They also don’t seem to move their left and right legs out of sync like bipeds.
    The motion goes in waves, so i needed to add a “phase” to the animation, also depending on layerindex, and added a control to have more than 1 step per second.
    Ideally this could also be linked to speed…

    so result so far=

    Now I cheated, because there are problems when the millipede needs to start or stop…
    That can be worked around with precomposing and time-remapping.
    It depends on what you need.

    Here is the project file:

    centipede.aep

    some advice:

    it deliberately made the path so thet the bends were not too narrow: that way the feet don’t intersect and the sections of the body keep lining up. A real millipede also can’t cut a 45 degree corenr so…

  • Jeff Mcbride

    July 24, 2007 at 5:52 pm

    Amazing work! I’m completely impressed. I should have CS3 soon so I can try it with shape layers, I’ve been work with solids/masks which I presume are fairly similar. I’ll try it soon and see if I’ve got any questions, great work though!

  • Adrián Wulfrath

    May 10, 2016 at 12:51 am

    Hey my friend, i saw that you post a Centipede.aep can you share it again please.

  • Filip Vandueren

    May 10, 2016 at 6:56 am

    Unfortunately I have lost most of my old shared projects from this forum…

  • Filip Vandueren

    May 10, 2016 at 11:03 am

    I recreated the project from my own description 😎

    10070_caterpillar.aep.zip

    I added lots of controls, i hope everything is clear…

    Same problem remains at start and end of the animation.

  • Adrián Wulfrath

    May 10, 2016 at 3:53 pm

    Damn, but can you help me, im doing a centipede, actually i did various null objects in Cinema 4D with the body movement to replace that nulls to shapes, but the only thing that i need is the centipede feet when the base null object move, move the feet like centipede. Can you help me please?

  • Adrián Wulfrath

    May 10, 2016 at 3:54 pm

    Thank you very much

  • Filip Vandueren

    May 10, 2016 at 4:36 pm

    Hmm…

    Depends on the look you’re going for, but real 3D legs are not possible this way. Only rubbery stick animations.

    Maybe post an example of what you’re working on?

  • Adrián Wulfrath

    May 10, 2016 at 4:56 pm

    10072_centipede.mp4.zip

    Here is the Video.

Page 1 of 2

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