Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions brain hurt

  • Expressions brain hurt

    Posted by Jamesc on June 29, 2006 at 5:03 pm

    Hi guys,

    I used some expressions to make this:

    https://www.mintylamb.co.uk/upload/3dengine.mp4

    Seems to work ok – but I am trying to automate it a bit more. That was all pretty much keyframed.

    It’s pretty simple – flat layers that are constantly facing the camera – linked with the rotational position. (the 3d objects are actually flat)

    I want to build this all using null objects – using a central pivot – with 18 layers around the edge.

    I’ve tried parenting null objects – making “arms” and “wrists” – sizes, anchor points – and it never seems to quite work properly.

    I am loving these expressions – but I can’t get this figured.

    James

    Jamesc replied 19 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • Mylenium

    June 29, 2006 at 5:48 pm

    A circle is defined by sinus and cosinus, so your setup could be expressed as


    center=thisComp.layer(“Center”).position;
    radius=500;

    X=Math.sin(degreesToRadians(360/(thisComp.numLayers-1)*index))*radius;
    Y=100;
    Z=Math.cos(degreesToRadians(360/(thisComp.numLayers-1)*index))*radius;

    [X,Y,Z]

    If applied to positions, this will create a radial array of layers based on the number of layers in the composition. for the orientation, simply use auto-orient or re-build the functionality using e.g. code from my World Map tutorial.

    If you want, you can even automate the fading based on the current angle of a layer using something like linear(angle,start_angle,end_angle,100,0) (it’s a bit more complex to actually derive usable angles, but you should get the idea)

    Mylenium

    [Pour Myl

  • Mike Clasby

    June 29, 2006 at 8:05 pm

    Oooo, I like that expression, great one for us Mathmatically challenged.

  • Jamesc

    June 29, 2006 at 10:36 pm

    Excellent! Thank you so much.

    I set the auto-orient to “face camera” and set the center as the layers parents – and now I can control that perfectly.

    I also changed the code so that it only made 18 items (the max I am going to have) in the array:

    X=Math.sin(degreesToRadians(360/(18)*index))*radius;
    Y=100;
    Z=Math.cos(degreesToRadians(360/(18)*index))*radius;

    Many Thanks, James.

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