Bugfix #17490
authorTon Roosendaal <ton@blender.org>
Sun, 7 Sep 2008 10:24:02 +0000 (10:24 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 7 Sep 2008 10:24:02 +0000 (10:24 +0000)
Camera feature "DOF Object" was drawing the cross marker on wrong location
when camera scales. Simple fix by using Mat4Ortho()

source/blender/blenkernel/intern/object.c

index 8879b498ad9a931a6e2a7b36718b4ea0a2f881e1..3ed169ff77daf04df2446cbab7ec84363d85e64a 100644 (file)
@@ -697,9 +697,11 @@ float dof_camera(Object *ob)
        if (cam->dof_ob) {      
                /* too simple, better to return the distance on the view axis only
                 * return VecLenf(ob->obmat[3], cam->dof_ob->obmat[3]); */
+               float mat[4][4], obmat[4][4];
                
-               float mat[4][4];
-               Mat4Invert(ob->imat, ob->obmat);
+               Mat4CpyMat4(obmat, ob->obmat);
+               Mat4Ortho(obmat);
+               Mat4Invert(ob->imat, obmat);
                Mat4MulMat4(mat, cam->dof_ob->obmat, ob->imat);
                return fabs(mat[3][2]);
        }