mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0027629: Visualization - apply a correct model-world matrix to normals in fixed function pipeline with enabled zoom persistence.
Small correction of test case for issue CR27629
This commit is contained in:
@@ -474,14 +474,6 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
aCtx->ModelWorldState.Push();
|
||||
aCtx->ModelWorldState.SetCurrent (Transformation);
|
||||
|
||||
// detect scale transform
|
||||
const Standard_Boolean anOldGlNormalize = aCtx->IsGlNormalizeEnabled();
|
||||
const Standard_ShortReal aScaleX = Transformation.GetRow (0).xyz().SquareModulus();
|
||||
if (Abs (aScaleX - 1.f) > Precision::Confusion())
|
||||
{
|
||||
aCtx->SetGlNormalizeEnabled (Standard_True);
|
||||
}
|
||||
|
||||
if (TransformPersistence.Flags)
|
||||
{
|
||||
OpenGl_Mat4 aProjection = aCtx->ProjectionState.Current();
|
||||
@@ -495,6 +487,14 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
aCtx->ApplyProjectionMatrix();
|
||||
}
|
||||
|
||||
// detect scale transform
|
||||
const Standard_Boolean anOldGlNormalize = aCtx->IsGlNormalizeEnabled();
|
||||
const Standard_ShortReal aScaleX = aCtx->ModelWorldState.Current().GetRow (0).xyz().SquareModulus();
|
||||
if (Abs (aScaleX - 1.f) > Precision::Confusion())
|
||||
{
|
||||
aCtx->SetGlNormalizeEnabled (Standard_True);
|
||||
}
|
||||
|
||||
// Take into account transform persistence
|
||||
aCtx->ApplyModelViewMatrix();
|
||||
|
||||
|
Reference in New Issue
Block a user