1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-01 10:26:12 +03:00
occt/tests/bugs/vis/bug22701
apl 197ac94e72 0024413: Visualization - get rid of projection shift from orthographic camera definition
From now on, the panning behavior of V3d_View completely corresponds to equal operations with camera. There is no more confusing "Center" property and "ProjectionShift" which were used to introduce composite panning, while respecting view referential points: At, Eye unchanged. The V3d_View::FitAll approach has been rewritten to do "fit all" geometrically, operating with frustum, to make it working for both orthographic and perspective projections.

1) Getting rid of ProjectionShift and Center property:
- Removed ProjectionShift property of Graphic3d_Camera.
- Removed confusing Center property of V3d_View (related to projection shift).
- Removed redundant code related to the Center property of V3d_View.
- Removed WindowLimit method of Graphic3d_Camera - no more used.

2) Improvements of fit all and selector:
- Improved FitAll operation of V3d_View and reused it in NIS_View - the perspective projection is now handled correctly.
- Revised code of Select3D_Projector class - can be defined with any given projection and model-view matrices.
- Modified StdSelect_ViewerSelector3d and ensured that panning, zooming and going into the view do not lead to unwanted re-projection of sensitives. The handling of perspective selection is revised.
- Take into account graphical boundaries of infinite structure on ZFitAll.

3) Improvements of camera:
- Introduced new z range scale parameter for V3d_View::AutoZFit. See, V3d_View::AutoZFitMode.
- Allow negative ZNear, ZFar for orthographic camera to avoid clipping of viewed model.
- Moved camera ZNear, ZFar validity checks to V3d_View level.
- Use more meaningful Standard_ShortReal relative precision for ZNear, ZFar ranges computed by ZFitAll.
- Use Standard_Real type for camera projection and orientation matrices.
- Extended camera to generate both Standard_Real and Standard_ShortReal transformation matrices using the same matrix evaluation methods and converted input parameters.

Correcting picking tests for perspective view

Modify v3d face test cases for 1px changes in face picking

Modified test cases for new arguments of vviewparams DRAWEXE command
2014-03-06 15:50:33 +04:00

54 lines
1.1 KiB
Plaintext
Executable File

puts "============"
puts "OCC22701"
puts "============"
puts ""
#######################################################################
# Regression in 6.5.1 - Wrong visualization
#######################################################################
set BugNumber OCC22701
# Data
set scale 276.45658048904141
set proj_X -0.8895147442817688
set proj_Y -0.37965071201324463
set proj_Z 0.25422060489654541
set up_X -0.055201318114995956
set up_Y 0.64161688089370728
set up_Z 0.76503568887710571
set at_X 0.248127012715387
set at_Y 0.109238834542233
set at_Z -1.2607059785715
set x1 105
set y1 275
set x2 112
set y2 248
set Hole1_R 1
set Hole1_G 0.76470500230789185
set Hole1_B 0.16078400611877441
set Hole2_R 0.68235200643539429
set Hole2_G 0.48235198855400085
set Hole2_B 0.078431002795696259
# Start
restore [locate_data_file PFS04041r1.brep] result
vinit
vdisplay result
vfit
vsetdispmode 1
vfit
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
checkcolor ${x1} ${y1} ${Hole1_R} ${Hole1_G} ${Hole1_B}
checkcolor ${x2} ${y2} ${Hole2_R} ${Hole2_G} ${Hole2_B}
set only_screen 1