- Home /
Blender and Unity Camera Setup
I've read through a few popular "matching blender and unity camera" posts throughout the internet, but nothing seems to satisfy my particular issue. In Unity, I have the camera in the correct location and angle (having used an empty object in Blender to cultivate the information on import), and I've setup the FoV for my Unity camera to match (in degrees) the same FoV in Blender.
The scene is constructed in such a way that several 2D plane elements line up perfectly with each other in relation to the camera's location / rotation. While the geometry in the scene does indeed line up in Unity as well, the bounds/resolution of the camera seem to be off by quite a bit. I have Blender's camera resolution set to 1920x1080 and 1:1 aspect ratio. Rendering the scene with these settings produces a file with that resolution, as you would expect and the scene fits perfectly within the camera frame. In Unity I have the game resolution set to 1920x1080, but the scene does not fit perfectly within the frame. There's a border around the scene as if the camera were too far away or the FoV were incorrect, even though I've checked and double-checked the settings between the two applications.
There is no code to modify any of the factors at the moment. The project is still in it's infancy.
Any guidance on what I may have missed would be very much appreciated.
Very respectfully, Tyler
Answer by yumupdate · Nov 21, 2012 at 01:47 AM
So I had to do some math provided by another Unity Answer post that I initially misunderstood. My error was in providing a 1:1 Aspect Ratio into the equation below (and trusting Blender's automagical drop-down's conversion, which was incorrect for my needs). I wanted a 16:9 ratio, which in the other Unity Answers example was 1.7777 as well.
I typed the following into Google and got back my answer and it looks spot-on in Unity. Do not rely on Blender's translation from millimeters to degrees in the camera settings tab ... also, don't trust your late-night brain :)
Google-Fu for 16:9 Aspect Ratio (1.77777) and a 22.5mm Focal Length in Blender:
2 atan(16 / (1.77777 * 22.5)) in degrees
Coming out to be 43.602 (give or take)
Reference post: Camera Matching Blender to Unity
Your answer
Follow this Question
Related Questions
Matching Camera Position Blender/Unity 1 Answer
Negative results when converting HFOV to VFOV? 1 Answer
Weird Blender camera animation issue 2 Answers
A node in a childnode? 1 Answer
Orthographic Camera 2 Answers