diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-09-03 21:54:04 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-09-03 21:54:04 +0400 |
commit | 192935eb0493e6b1685ad5e867b4d1c9a4ed112a (patch) | |
tree | bb4e916eedeb5f7c604029388352b6c821cb2163 /source/blender/collada/DocumentImporter.cpp | |
parent | a2515f3ca060500e0407bf39ec261e884c254765 (diff) |
fix:32348 Collada yfov to xfov conversion fo camera settings
Diffstat (limited to 'source/blender/collada/DocumentImporter.cpp')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 60b03a211ba..e171cfecc23 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -867,9 +867,11 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera) { double yfov = camera->getYFov().getValue(); double aspect = camera->getAspectRatio().getValue(); - double xfov = aspect * yfov; - // xfov is in degrees, cam->lens is in millimiters - cam->lens = fov_to_focallength(DEG2RADF(xfov), cam->sensor_x); + + // NOTE: Needs more testing (As we curretnly have no official test data for this) + + double xfov = 2.0f * atanf(aspect * tanf(DEG2RADF(yfov) * 0.5f)); + cam->lens = fov_to_focallength(xfov, cam->sensor_x); } break; } |