Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple X rotation expression

  • Simple X rotation expression

    Posted by Dan Lachevre on October 7, 2007 at 4:10 am

    Hi all

    Wondering if there is a simple expression based solution to this problem.

    I have a comp based on Andrew Kramers very helpful tute Crating Light Streaks 2 where he uses a null to control a Particular emitter. I have some footage where someone throws a football to someone else who catches it. I want to get the light streaks to follow the ball, which is easier enough, but I want them to circle the ball as it travels from right to left. I’ve tried doing this manually but it is painful. Is there a simple expression, like a wiggle, that can set the null to do rotation around the x axis as it travels?

    The football in the air was shot separately [rotating on a turntable] and travels through the 3d environment along the x and z axis…mainly x.

    Any ideas would be most appreciated.

    Cheers

    Danny

    Mike Clasby replied 18 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Mike Clasby

    October 7, 2007 at 6:43 pm

    So the Null’s riding with the football, parented to it?

    1) It seems like you should be able to offset the null from the football to whatever you want the radius of the circle to be, then move the Null’s anchor point back onto the football (with the Pan behind tool). Do this in a second view set to Left or Right so you get a sideon. Then if you rotate the Null”s X rotation you should have what you want.

    2) If the Null’s position starts out the same as the football’s rotation (they’re in the same spot to start), here’s a Dan Ebberts expression for orbital rotation, modified for 3D, same as an X rotation of the Null (methinks). Put this on position:

    r = 75//radius (in pixels)
    f = 1//orbits per second

    angle = time*Math.PI*2*f;
    value + [[0],Math.sin(angle)*r, -Math.cos(angle)*r]

    If the rotation is wrong, like my test was setup in a different axis, then change the last line to this:

    value + [Math.sin(angle)*r, -Math.cos(angle)*r, [2]]

    or this:

    value + [Math.sin(angle)*r, [1], -Math.cos(angle)*r]

    That just changes the axis it rotates around, one of them should work for you.

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