Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 3D scale formula for 2D layers

  • 3D scale formula for 2D layers

    Posted by Jerzy Drozda jr on January 5, 2008 at 3:35 am

    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?

    Jerzy Drozda jr replied 18 years, 4 months ago 1 Member · 1 Reply
  • 1 Reply
  • Jerzy Drozda jr

    January 5, 2008 at 4:48 am

    Nevermind. Finally got it figured out.

    Did it ever happened to you that you were fighting with a problem for hours trying to solve it, but ended up with nothing. Than in desperation ask a question on a forum, and than almost instantly found an answer? 🙂 I’m just courieous because it happend to me a lot when developing flash applications. This is the first time in AE 🙂

    anyway… i whould have used:
    scaleFactor = focalLength/z
    [scale*100,scale*100,scale*100]

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy