Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions coverflow sort of???

  • coverflow sort of???

    Posted by Jason Shevchuk on July 20, 2009 at 9:27 pm

    I’m trying to animate a menu.
    when the tab is in the middle it is straight.
    when it goes up or down it pushes back in z space and rotates towards the floor.
    I’ve got 9 tabs that follow this movement.

    I’ve tried all day to get this to work….it’s driving me crazy.
    can anyone help.

    thanks

    Ben Rollason replied 16 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Ben Rollason

    July 23, 2009 at 11:03 am

    Okay… I’ve got a comp 860×484… don’t know why that size, but anyway.

    In the middle is a blue solid 200×200, which sits at [430, 242].

    On to this solid (which is a 3D layer) I set position to…

    origTY = 242; // orig (central) y position.
    tMaxHeight = 200; //max y movement above or below origTY
    tDepth = tMaxHeight*3; //you can make this more than max height to exagerrate the depth. At 1, the object will describe a circle.

    tY = transform.position[1];
    tY = (tY > origTY + tMaxHeight?origTY + tMaxHeight: (tY < origTY - tMaxHeight? origTY - tMaxHeight: tY)); //clamp tY so it can't move outside its upper or lower bounds. acosY = Math.acos((tY-242)/tMaxHeight); tZ = Math.sin(acosY); [transform.position[0], tY,(-tZ*tDepth)+tDepth];

    and orientation to...

    origTY = 242; //orig (central) y position
    tFactor = 1.5; //adjust for more or less rotation
    xRot = transform.position[2]/10;
    [-tFactor * xRot * (((transform.position[1] > origTY)*2)-1), transform.orientation[1], transform.orientation[2]]

    I think that gives you something like you're after. The trigonometry causes the solid to move back in space in a circular fashion. It's essentially describing a circle with a central point tMaxHeight behind your solid. The movement is driven by animating the y position.

    The rotation is arbitrary, based on the movement back in z space.

    Hope that helps,

    -Ben.

    http://www.benrollason.com

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