diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-19 22:35:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-19 22:35:42 +0400 |
commit | 5d2a155f2bcc2d6d77d3a3753c23027b06942540 (patch) | |
tree | f7516f66a00293452972ac009e4a40faeeccbe45 /source/blender/modifiers | |
parent | d9e99abe3753591d510dbb58813bbc29e3381b57 (diff) |
Camera: some more refactoring, mostly in the function that computes the camera
border, now we just get the border coordinates from comparing the viewport and
camera viewplanes.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_uvproject.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index df528a0cb11..6f0ba9259b8 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -195,20 +195,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, free_uci= 1; } else { - float sensor= (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : cam->sensor_x; + float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); + int sensor_fit= camera_sensor_fit(cam->sensor_fit, aspx, aspy); float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale; float xmax, xmin, ymax, ymin; - if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - if(aspect > 1.0f) { - xmax = 0.5f * scale; - ymax = xmax / aspect; - } else { - ymax = 0.5f * scale; - xmax = ymax * aspect; - } - } - else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) { + if(sensor_fit==CAMERA_SENSOR_FIT_HOR) { xmax = 0.5f * scale; ymax = xmax / aspect; } |