Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 30 Oct 2011 23:58:21 +0000 (23:58 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 30 Oct 2011 23:58:21 +0000 (23:58 +0000)
===========================

Fix for collada importer/exporter.

source/blender/collada/CameraExporter.cpp
source/blender/collada/DocumentImporter.cpp

index 98a3b1439f94fb4c14205a8a55532b0a2c836c56..fcb98cc7c32d10f9dd9e152a3f03c31ba80d76c0 100644 (file)
@@ -71,7 +71,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce)
        
        if (cam->type == CAM_PERSP) {
                COLLADASW::PerspectiveOptic persp(mSW);
-               persp.setXFov(RAD2DEGF(focallength_to_hfov(cam->lens, cam->sensor_x)), "xfov");
+               persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov");
                persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio");
                persp.setZFar(cam->clipend, false , "zfar");
                persp.setZNear(cam->clipsta,false , "znear");
index 0926899bdaf086ff47281696495c59f173896c28..8cdb1065699b66b23cd5f17f68de1c7c1ee6fda0 100644 (file)
@@ -814,7 +814,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                                double aspect = camera->getAspectRatio().getValue();
                                                double xfov = aspect*yfov;
                                                // xfov is in degrees, cam->lens is in millimiters
-                                               cam->lens = hfov_to_focallength(DEG2RADF(xfov), cam->sensor_x);
+                                               cam->lens = fov_to_focallength(DEG2RADF(xfov), cam->sensor_x);
                                        }
                                        break;
                        }
@@ -835,7 +835,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                        {
                                                double x = camera->getXFov().getValue();
                                                // x is in degrees, cam->lens is in millimiters
-                                               cam->lens = hfov_to_focallength(DEG2RADF(x), cam->sensor_x);
+                                               cam->lens = fov_to_focallength(DEG2RADF(x), cam->sensor_x);
                                        }
                                        break;
                        }
@@ -852,7 +852,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                        {
                                        double yfov = camera->getYFov().getValue();
                                        // yfov is in degrees, cam->lens is in millimiters
-                                       cam->lens = hfov_to_focallength(DEG2RADF(yfov), cam->sensor_x);
+                                       cam->lens = fov_to_focallength(DEG2RADF(yfov), cam->sensor_x);
                                        }
                                        break;
                        }