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();
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();
--- /dev/null
+puts "========"
+puts "OCC27629"
+puts "========"
+puts ""
+##############################################################################################################################
+puts "Visualization - apply a correct model-world matrix to normals in fixed function pipeline with enabled zoom persistence."
+##############################################################################################################################
+
+vinit
+box b0 25 25 25
+vsetdispmode 1
+vdisplay b0 -trsfPers zoom
+vzoom 10
+
+if { [vreadpixel 220 200 name] != "DARKGOLDENROD3 1"} {
+ puts "Error: normals aren't normalized!"
+}
+
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png