diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-04 18:36:06 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-04 18:36:06 +0400 |
commit | 4ea816837de646af124ffc82758cae37950a0a51 (patch) | |
tree | 771c7a0e084446080d6f6d12258585a479bf2887 /source/blender/collada | |
parent | 82dc05391cdda573f1523325bfd4c6a2a5233323 (diff) |
Configurable sensor size:
- Added support of variable size sensor width and height.
- Added presets for most common cameras, also new presets can be defined by user.
- Added option to control which dimension (vertical or horizontal) of sensor
size defines FOV. Old behavior of automatic FOV calculation is also kept.
- Renderer, viewport, game engine and collada importer/exporter should
deal fine with this changes. Other exporters would be updated soon.
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/CameraExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index 6fa2c8763e0..fcb98cc7c32 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -71,7 +71,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) if (cam->type == CAM_PERSP) { COLLADASW::PerspectiveOptic persp(mSW); - persp.setXFov(RAD2DEGF(lens_to_angle(cam->lens)), "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"); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 8d133979fa4..8cdb1065699 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -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 = angle_to_lens(DEG2RADF(xfov)); + 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 = angle_to_lens(DEG2RADF(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 = angle_to_lens(DEG2RADF(yfov)); + cam->lens = fov_to_focallength(DEG2RADF(yfov), cam->sensor_x); } break; } |