Copy link to clipboard
Copied
Hi,
I have a 2D layer following a 3D layer using toComp in an expression, and its working really well. However, when the 3D layer gets closer to the camera, it appears as if its bigger, and I'd like the 2D layer's actual size to match the 3D layer's apparant size. Is it posible to do this in an expression? Thanks,
--Saib
There is more than one possible answer to your question, depending on what you're doing. For example, if your 3D layer always faces the camera, a scale expression like this should work:
L = thisComp.layer("my3DLayer");
p1 = L.toComp([0,0,0]);
p2 = L.toComp([L.width,0,0]);
d = length(p1,p2);
value*d/L.width
Dan
Copy link to clipboard
Copied
There is more than one possible answer to your question, depending on what you're doing. For example, if your 3D layer always faces the camera, a scale expression like this should work:
L = thisComp.layer("my3DLayer");
p1 = L.toComp([0,0,0]);
p2 = L.toComp([L.width,0,0]);
d = length(p1,p2);
value*d/L.width
Dan
Copy link to clipboard
Copied
That worked wonderfully! Thank you so much!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now