Orange bug: forgot to restore inverse matrix calculus for OpengGL render
[blender.git] / source / blender / src / drawview.c
index f5dc0f458cf42e95a3500458b4546cf6ba9b08ff..5e8cc3225eecac734dcf3f40d770c5bf3d9f5802 100644 (file)
@@ -2389,16 +2389,20 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy)
 {
        Base *base;
        Scene *setscene;
-
+       float winmat[4][4];
+       
        update_for_newframe_muted();    /* first, since camera can be animated */
 
        setwinmatrixview3d(winx, winy, NULL);
        
        setviewmatrixview3d();
        myloadmatrix(v3d->viewmat);
-//     Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat);
-//     Mat4Invert(v3d->persinv, v3d->persmat);
-//     Mat4Invert(v3d->viewinv, v3d->viewmat);
+       glMatrixMode(GL_PROJECTION);
+       mygetmatrix(winmat);
+       glMatrixMode(GL_MODELVIEW);
+       Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat);
+       Mat4Invert(v3d->persinv, v3d->persmat);
+       Mat4Invert(v3d->viewinv, v3d->viewmat);
 
        free_all_realtime_images();
        reshadeall_displist();