Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Convert camera FOV to zoom distance?

  • Convert camera FOV to zoom distance?

    Posted by Spencer Tweed on September 5, 2013 at 6:17 pm

    Hey guys, I’m working on a script to import 3D data from an XML file into after effects and I’ve hit a kind of silly problem… Basically all I’m trying to do is convert Field of View (degrees) to “zoom” (pixels) so that I can properly match an AE camera to one in my 3D app. I chose FOV because it is the most reliable value, it doesn’t rely on the sensor size which can sometimes come out differently in AE vs whatever 3D app is exporting the XML (3DS Max in this particular case). Unfortunately the only value in After Effects I have access to is this somewhat obscure “zoom” value…

    Thanks!
    – Spencer

    When I finish this script I’ll be posting it for free, it allows you to export animated cameras, points and (eventually) lights from 3DS Max to AE! I wrote it so that anyone can code their own exporter from other 3D packages and AE just reads in an XML file to create it’s scene.

    Spencer Tweed replied 12 years, 8 months ago 3 Members · 5 Replies
  • 5 Replies
  • Walter Soyka

    September 5, 2013 at 6:41 pm

    zoom = thisComp.width/(2*Math.tan(degreesToRadians(FOV/2)));

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Darby Edelen

    September 5, 2013 at 8:50 pm

    [Walter Soyka] “zoom = thisComp.width/(2*Math.tan(degreesToRadians(FOV/2)));”

    Walter’s expression is perfect for a horizontal FOV, which is generally the most common. However, the data from your 3D camera may be stored as a vertical or diagonal FOV in which case the expression will vary slightly:

    Vertical

    zoom = thisComp.height /(2*Math.tan(degreesToRadians(FOV/2)));

    Diagonal

    w = thisComp.width;
    h = thisComp.height;
    d = Math.sqrt((w * w) / (h * h));
    zoom = d /(2*Math.tan(degreesToRadians(FOV/2)));

    Darby Edelen

  • Walter Soyka

    September 5, 2013 at 9:29 pm

    [Darby Edelen] “Walter’s expression is perfect for a horizontal FOV, which is generally the most common. However, the data from your 3D camera may be stored as a vertical or diagonal FOV in which case the expression will vary slightly:”

    Great point. I was absolutely thinking in Ae terms here, but Smoke’s camera uses a vertical FOV. That may apply for other ADSK products like 3ds Max, too.

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Spencer Tweed

    September 5, 2013 at 10:47 pm

    Awesome! All bases covered, thanks!

    – Spencer

  • Spencer Tweed

    September 5, 2013 at 10:49 pm

    Thanks for the quick reply, looks like exactly what I need! Max does all 3, but in this case I’m exporting horizontal.

    – Spencer

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