ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

3D Point Control to 2D X,Y

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Graham Quince
3D Point Control to 2D X,Y
on Jun 18, 2017 at 3:45:13 pm

I'm trying to create an expression to combine a Z-Depth slider into a 2D coordinates.

I'm going to be using this a lot so wanted to save it as a preset, as in other circumstances, I'd create a Null layer, set it as 3D and use toComp([0,0,0]) to get the desired result.

I can't find out how to do this with the raw numbers. Any ideas?

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films
http://shiveringcactus.wordpress.com/ - FX blog


Return to posts index

Walter Soyka
Re: 3D Point Control to 2D X,Y
on Jun 19, 2017 at 3:44:49 pm

Give this a spin:


x = effect("Point Control")("Point")[0];
y = effect("Point Control")("Point")[1];
z = effect("Slider Control")("Slider");

zoom = thisComp.activeCamera.zoom;
depthScale = zoom / (zoom + z);

offset = [x,y] - [thisComp.width/2, thisComp.height/2];
scaledOffset = offset * depthScale;
[thisComp.width/2, thisComp.height/2] + scaledOffset;


You'll need to provide your own values for x, y and z.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Graham Quince
Re: 3D Point Control to 2D X,Y
on Jun 19, 2017 at 9:06:00 pm

Works brilliantly. Thanks very much - I lost hours on Sunday looking for the answer.

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films
http://shiveringcactus.wordpress.com/ - FX blog


Return to posts index

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