X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FOpenGl%2FOpenGl_Flipper.cxx;h=ff45c16cf567388613d0df3c607d593bae3fe1f3;hb=ab9e277f15988c69343b64ac487163b41ec120f4;hpb=0439d1cf4488bb60804531b1e33a7b6d8feaa4bb diff --git a/src/OpenGl/OpenGl_Flipper.cxx b/src/OpenGl/OpenGl_Flipper.cxx index b3322df22d..ff45c16cf5 100755 --- a/src/OpenGl/OpenGl_Flipper.cxx +++ b/src/OpenGl/OpenGl_Flipper.cxx @@ -69,15 +69,19 @@ void OpenGl_Flipper::Render (const Handle(OpenGl_Workspace)& theWorkspace) const if (!myIsEnabled) { // restore matrix state - aContext->WorldViewState.Pop(); + aContext->ModelWorldState.Pop(); // Apply since we probably in the middle of something. - aContext->ApplyModelViewMatrix(); + aContext->ApplyModelWorldMatrix(); return; } - aContext->WorldViewState.Push(); - OpenGl_Mat4 aMatrixMV = aContext->WorldViewState.Current() * aContext->ModelWorldState.Current(); + aContext->ModelWorldState.Push(); + + OpenGl_Mat4 aModelWorldMatrix; + aModelWorldMatrix.Convert (aContext->ModelWorldState.Current()); + + OpenGl_Mat4 aMatrixMV = aContext->WorldViewState.Current() * aModelWorldMatrix; const OpenGl_Vec4 aMVReferenceOrigin = aMatrixMV * myReferenceOrigin; const OpenGl_Vec4 aMVReferenceX = aMatrixMV * OpenGl_Vec4 (myReferenceX.xyz() + myReferenceOrigin.xyz(), 1.0f); @@ -129,11 +133,11 @@ void OpenGl_Flipper::Render (const Handle(OpenGl_Workspace)& theWorkspace) const aTransform = aRefAxes * aTransform * aRefInv; // transform model-view matrix - aMatrixMV = aMatrixMV * aTransform; + aModelWorldMatrix = aModelWorldMatrix * aTransform; // load transformed model-view matrix - aContext->WorldViewState.SetCurrent (aMatrixMV); - aContext->ApplyWorldViewMatrix(); + aContext->ModelWorldState.SetCurrent (aModelWorldMatrix); + aContext->ApplyModelWorldMatrix(); } // =======================================================================