-
Another “get 2D point from 3D co-ordinates” question…but different
Hello,
I’ve got a shot which I’ve tracked successfully and have a 3D camera. The shot is a slow pan across some objects. I need to remove something from one of the objects, so I’ve placed a 3D solid in the comp to cover it and it all works nicely. What I now want to do, is use a 4-Color Gradient to add a gradient to the solid that matches four of the colours of the underlying footage. I tried adding this expression to each of the four colours in the 4-Color Gradient effect:sourceLayer = thisComp.layer("main_footage.mov");
p = effect("4-Color Gradient")("Point 1"); // position of the pixel you want to sample
r = [3,3]; // radius of the sample point
sourceLayer.sampleImage(p,r)
(obviously changing “Point 1” to “Point 2”, etc. for each of the 4 points)If everything was 2D, this would work perfectly. But my Solid layer is 300×300 pixels, the main_footage.mov layer is 1920×1080 and the Solid layer is sitting in 3D space. So the 4-Color Gradient’s “Point 1” might be at 30,30 but in real life in the comp, it’s at something like 800,600. How can I get the absolute value of this point? I’ve tried adding .toComp to various bits without success.
Any suggestions, anyone, please?
motion graphics | VFX | web design | etc.
https://paulroper.com/