diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 6d6b6a8fb8e..a448a7fd8db 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -835,7 +835,6 @@ int view3d_test_clipping(View3D *v3d, float *vec) float view[3]; VECCOPY(view, vec); - Mat4MulVecfl(v3d->viewmat, view); if(0.0f < v3d->clip[0][3] + INPR(view, v3d->clip[0])) if(0.0f < v3d->clip[1][3] + INPR(view, v3d->clip[1])) diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 6e43018c9c6..342305e215b 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -268,11 +268,12 @@ void view3d_get_object_project_mat(ScrArea *area, Object *ob, float pmat[4][4], Mat4MulMat4(vmat, ob->obmat, vd->viewmat); Mat4MulMat4(pmat, vmat, vd->winmat1); + Mat4CpyMat4(vmat, ob->obmat); } } -/* projectmat brings it to window coords, viewmat to rotated view (eye space) */ -void view3d_project_short_clip(ScrArea *area, float *vec, short *adr, float projmat[4][4], float viewmat[4][4]) +/* projectmat brings it to window coords, wmat to rotated world space */ +void view3d_project_short_clip(ScrArea *area, float *vec, short *adr, float projmat[4][4], float wmat[4][4]) { View3D *v3d= area->spacedata.first; float fx, fy, vec4[4]; @@ -282,7 +283,7 @@ void view3d_project_short_clip(ScrArea *area, float *vec, short *adr, float proj /* clipplanes in eye space */ if(v3d->flag & V3D_CLIPPING) { VECCOPY(vec4, vec); - Mat4MulVecfl(viewmat, vec4); + Mat4MulVecfl(wmat, vec4); if(view3d_test_clipping(v3d, vec4)) return; }