Skip to main content
Inspiring
January 19, 2023
Question

Looking for a formula to convert for Camera.Zoom attribute from degrees to pixels...

  • January 19, 2023
  • 2 replies
  • 729 views

Good afternoon.

 

In After Effects, the camera layer has a .zoom attribute
Attribute Units: Pixels, Millimeters, Inches

 

app.project.item(1).layer("Camera 1").Zoom.value --> 1777,7778 Pixels

 

In 3DS MAX app, camera has .fov attribute 
Attribute units: degree

 

 $Camera001.fov --> 39.598 degree

 

If you dive deep into the theory about the conversion of these quantities, for a real camera, then there
you can drown...

Let's say that in the After Effects scene there is a camera that has the following parameters.

 


Looking for a formula to convert for this attribute from degrees to pixels ...,
to get camera equality in 3DS MAX and camera in After Effects


Anyone faced this issue???

This topic has been closed for replies.

2 replies

Mylenium
Brainiac
January 19, 2023

No idea what filmback Mac assumes and what their specific tweaks of the formula are. Generally the math should work, though.

 

Mylenium 

AnyONAuthor
Inspiring
January 19, 2023

Found!!!

With render settings in 3dmax, you can choose a preset, such as HDTV (video) --> 1280x720 pixels.

With this option for this preset, the value of Aperture Width = 23.760 mm is pre-fixed
Or you can choose Custom as a preset, adjust --> 1280x720 pixels, and then the value of Aperture Width = 36.0 mm.

And with this option, the FOV values ​​are the same in both applications

Mylenium
Brainiac
January 19, 2023

If you correlate the filmback, projection plane and distances you can easily solve it with the law of cosines.

 

Mylenium

AnyONAuthor
Inspiring
January 19, 2023

There is a mismatch between FOV values for a standard 35mm camera in AE and 3ds MAX

 

AE Camera Preset  = 3ds Max Camera Lens = 35 mm

 

3ds Max Render Width = AE Width = 1280 pixels

3ds Max Render Heigtht = AE Heigtht = 720 pixels

-----------------------------------------------------------------

AE Camera FOV (Horizontally) = 54.43

3ds Max Camera FOV (Horizontally) = 37.497

---------------------------------------------------------------

 ????????

 

That's why I don't use trigonometry

Dan Ebberts
Community Expert
January 19, 2023

I'm not sure if this is what you're looking for:

z = thisComp.layer("Camera 1").cameraOption.zoom;
fov = radiansToDegrees(Math.atan2(thisComp.width/2,z))*2;