ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Time Remap sequence based on angle to camera

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeff McBride
Time Remap sequence based on angle to camera
on Jun 5, 2018 at 6:49:45 pm
Last Edited By Jeff McBride on Jun 5, 2018 at 6:49:59 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!!



Return to posts index

Kalleheikki Kannisto
Re: Time Remap sequence based on angle to camera
on Jun 6, 2018 at 10:57:58 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]