FORUMS: list search recent posts

Position relative to rotation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ross McDowell
Position relative to rotation
on Aug 5, 2016 at 6:41:08 pm


I have a null layer which contains tracking data for position and rotation. But I want to be able to attach this null to a 'Point Control' so I can adjust the position of the null layer.

However, if the null is rotated 45 degrees, and I change the Y value of my point control, the null layer moves up and down relative to the composition. But I want it to move up and down relative to the rotation of the null.

How is this possible?

Thank you!


Ross McDowell
Animation Student

Return to posts index

Kalle Kannisto
Re: Position relative to rotation
on Aug 6, 2016 at 7:22:22 am
Last Edited By Kalle Kannisto on Aug 6, 2016 at 7:32:45 am

For example like this, when the point control is on the null layer.

xd = effect("Point Control")("Point")[0];
yd = effect("Point Control")("Point")[1];
a = transform.rotation/180*Math.PI;
xx = xd*Math.cos(a);
xy = xd*Math.sin(a);
yx = yd*Math.cos(a+Math.PI/2);
yy = yd*Math.sin(a+Math.PI/2);

transform.position + [xx, xy] + [yx, yy]

There's probably an easier way to do this with layer space transformations.

Kalleheikki Kannisto
Senior Graphic Designer

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved