Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Time Remap sequence based on angle to camera

  • Time Remap sequence based on angle to camera

    Posted by Jeff Mcbride on June 5, 2018 at 6:49 pm

    I’m rendering a tree with a 360° turn, so each frame is .5 degrees of rotation, 720 frames total. I’ve got a null in 3D space that I need to calculate its angle to camera, and convert that into a time remap of the tree sequence so that the tree appears to rotate properly with the camera move.

    I’ve got this expression figuring out the Null angle to Camera, but having trouble converting that into a time remap (and a time remap that once it hits frame 720, loops back to frame 0).

    C = thisComp.layer(“Camera 1”);
    v1 = normalize(position – C.position)
    v2 = C.toWorldVec([0,0,1]);
    radiansToDegrees(Math.acos(dot(v1,v2)))

    Any help is greatly appreciated!!

    Kalleheikki Kannisto replied 7 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    June 6, 2018 at 10:57 am

    If you set the last line to a variable (angle) to A, as in

    A = radiansToDegrees(Math.acos(dot(v1,v2)));

    I would expect it to work by adding one more line:

    A%360*2*thisComp.frameDuration

    Not tested though.

    Kalleheikki Kannisto
    Senior Graphic Designer

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