diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c index ecb42315ee3..be7682a63d4 100644 --- a/source/blender/blenlib/intern/uvproject.c +++ b/source/blender/blenlib/intern/uvproject.c @@ -70,7 +70,7 @@ void project_from_camera(float target[2], float source[3], UvCameraInfo *uci) vec2d[0]= pv4[0]; vec2d[1]= pv4[2]; target[0]= angle * ((float)M_PI / uci->camangle); - target[1]= pv4[1] / (len_v2(vec2d) * uci->camsize); + target[1]= pv4[1] / (len_v2(vec2d) * (uci->camsize * 2.0f)); } } else { @@ -146,7 +146,11 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl uci.camangle= lens_to_angle(camera->lens) / 2.0f; uci.camsize= uci.do_persp ? tanf(uci.camangle) : camera->ortho_scale; - if (invert_m4_m4(uci.caminv, ob->obmat)) { + /* account for scaled cameras */ + copy_m4_m4(uci.caminv, ob->obmat); + normalize_m4(uci.caminv); + + if (invert_m4(uci.caminv)) { UvCameraInfo *uci_pt; /* normal projection */