From 6b9af22de99f57e37eef345a84607f675d7ed96a Mon Sep 17 00:00:00 2001 From: drochalo Date: Fri, 20 Oct 2023 18:40:09 +0100 Subject: [PATCH] 0027832: Visualization - Scaled zbuffer trihedron Minor update on axial scale test --- src/Graphic3d/Graphic3d_TransformPers.hxx | 4 +-- tests/v3d/trihedron/bug27832 | 40 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 tests/v3d/trihedron/bug27832 diff --git a/src/Graphic3d/Graphic3d_TransformPers.hxx b/src/Graphic3d/Graphic3d_TransformPers.hxx index f9c1e2ec8d..ab444de9a5 100644 --- a/src/Graphic3d/Graphic3d_TransformPers.hxx +++ b/src/Graphic3d/Graphic3d_TransformPers.hxx @@ -415,9 +415,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera, Standard_Real anAxialX = anAxialScale.X(); Standard_Real anAxialY = anAxialScale.Y(); Standard_Real anAxialZ = anAxialScale.Z(); - if ((anAxialX > Precision::Confusion() && - anAxialY > Precision::Confusion() && - anAxialZ > Precision::Confusion())) + if (anAxialX > 0 && anAxialY > 0 && anAxialZ > 0) { Graphic3d_TransformUtils::Scale(aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ); } diff --git a/tests/v3d/trihedron/bug27832 b/tests/v3d/trihedron/bug27832 new file mode 100644 index 0000000000..9778064a6e --- /dev/null +++ b/tests/v3d/trihedron/bug27832 @@ -0,0 +1,40 @@ +puts "========" +puts "0025340: 0027832: Visualization - Scaled zbuffer trihedron" +puts "========" +puts "" + +pload ALL +vinit +box b 10 10 10 +vdisplay b +vfit +vsetdispmode 1 +vzbufftrihedron -on +vscale 1 3 10 + +set color_1 [vreadpixel 55 360 -rgb -name] +set color_2 [vreadpixel 50 350 -rgb -name] +set color_3 [vreadpixel 55 355 -rgb -name] + +if {$color_1 != "RED3"} { + puts "ERROR: trihedron does not maintain position" + puts " additional investigation is needed" + puts " expected color is: RED3" + puts " current color is: $color_1" +} + +if {$color_2 != "BLUE3"} { + puts "ERROR: trihedron does not maintain position" + puts " additional investigation is needed" + puts " expected color is: BLUE3" + puts " current color is: $color_2" +} + +if {$color_3 != "GREEN3"} { + puts "ERROR: trihedron does not maintain position" + puts " additional investigation is needed" + puts " expected color is: GREEN3" + puts " current color is: $color_3" +} + +vdump $imagedir/${casename}.png \ No newline at end of file