Formula to convert Camera transform / fov from Motionbuilder or maya into Unity?

Hi guys,

I’m trying to figure out the formula to pass a camera transform pose ( including translate, rotate and fov ) from motion builder or Maya into unity and wondered if anyone could help me out?


Hi Mobo,

A quick search found this - its from Maya to Unity:

This code chunk looks like the conversion part for FOV:

#convert horizontalFOV to radians
horizontalFOVRAD = (horizontalFOV * pie )/ 180
#ran into a calculation issue down below when I didn't have horizontalFOVRAD divided
#I may need to learn more about math...
horizontalFOVRADhalf = float(horizontalFOVRAD/2)
#calculate verticalFOVRAD
verticalFOVRAD = 2 * math.atan ((math.tan(horizontalFOVRADhalf) * (renderHeight/renderWidth)))

As for transform it may just be either pulling the transform values directly or applying an offset/rotation for unity’s coordinate system.


Thanks chalk, that’s interesting. Yeah maybe I was being lazy, I started the process but something came up so I just wanted to check if anyone had the math already.


Not sure about Motionbuilder, but Maya can export FBX with the “Cameras” option enabled and they will be properly recognized by Unity as normal Unity Cameras with the correct settings applied.