Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Z space position offset in only negative direction with radial fall off

  • Z space position offset in only negative direction with radial fall off

    Posted by Rockie Ssengonzi on February 19, 2019 at 8:00 pm

    Expressions Gurus,
    Kindly help me out;
    I need you to point to how i can assemble an expression that can do this:
    Imagine a composition with many small 3D squares making up a grid facing the camera. I would want them to be offset radially from the z=0 through -(negative direction only ) such that those in the middle are offset /closer to the camera from their z=0 position and those on the sides a little closer to ther z= 0.

    Below is an illustration as seen from the top AE view

    Layers-> – –
    – –
    – –
    – –

    .camera.-> ₩

    It would be super awesome if the expression also arranged the layers in a gridlike arrangement on the xy axis.
    Any help is more than appreciated. I do know basic to medium level expressions but want to go deeper into the abyss so bring the big guns if needed.

    Rockie Ssengonzi
    for
    UGANDANE
    Simply With Finess & Flair

    Dan Ebberts replied 7 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 19, 2019 at 8:40 pm

    This might get you headed in the right direction:


    maxDisplacement = 100;
    maxRadius = 500;

    C = thisComp.layer("Camera 1");
    v1 = C.toWorldVec([0,0,1]);
    v2 = toWorld(anchorPoint) - C.toWorld([0,0,0]);
    a = Math.acos(clamp(dot(normalize(v2),v1),-1,1));
    d = length(v2)*Math.sin(a);
    zDisp = easeOut(d,0,maxRadius,maxDisplacement,0);
    value - [0,0,zDisp]

    Dan

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