-
3D scale formula for 2D layers
Hey
I’ve been trying to do this for two hours and i’m close, but I must be doing something wrong.
What I want to achieve is to been able to calculate the what the scale of a object placed in 3D space would be, if it was a 2D layer. I hope I made myself clear.
For example. Assume we have two layers and a camera in the composition. One of the layers is 3D. when we move camera closer or further away from the 3D layer it gets bigger or smaller. Now I’d like to calculate the scale so I could apply it to a 2D layer so they both look the same.
I tried to follow popular 3D camera formula that I know from my flash experiments:
scaleFactor = focalLength/(z+focalLength)
[scale*100,scale*100,scale*100]and it almost works, but not really.
Please someone help me out on this. I’d like it also to react to changes of Zoom and Focus distance parameters of the camera, since I want to use it with different cameras.
Any ideas?