Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression for X position and shadow effect question

  • Expression for X position and shadow effect question

    Posted by Stuart Baker on March 15, 2008 at 10:11 pm

    I have an animated ping pong ball on real footage of a table tennis match and I need to set up an expression of the same ball so that this ball copy follows the X position but not the Y position of the ball for the shadow.

    This is going to serve as the shadow of the ball (probably use the ‘drop shadow, shadow only’ effect): so I want the shadow to follow the balls path and then use opacity to show the ball’s shadow when it hits the table, obviously gaining in opacity when it nears the table.

    Can anyone tell me what the expression would be just for the x position and can anyone suggest a good way to make the shadow if my way is stupid? I was thinking maybe the drop shadow effect or perhaps set up a plane in 3D for the shadow to fall on?

    thanks!

    Curious Turtle replied 18 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Curious Turtle

    March 17, 2008 at 7:56 am

    Hi Stuart,

    Here’s a couple of expressions for you. Just apply them to a Drop Shadow effect on your ball layer.

    Drop Shadow Opacity:

    //Set up the highest and lowest points the ball hits;
    topPoint=200;
    bottomPoint=400;
    linear(transform.position[1],bottomPoint,topPoint,0,100)

    This is not entirely realistic, but looks OK. You can even add it to the Softness property too with a small change.

    topPoint=200;
    bottomPoint=400;
    linear(transform.position[1],bottomPoint,topPoint,100,20)

    To keep the shadow at a constant distance add this to the Distance property:

    a=transform.position[1]-288;
    150+a*-1

    Change the 150 to whatever you need.

    That’ll do for now :o)

    Good luck with your project,
    Ben

    Curious Turtle Professional Video
    Training | Editing |Support

    http://www.curiousturtle.com

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