Archived issue #0024291
Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Description
Seems more like a bug in OpenGl_Trihedron for perspective projection. OpenGl_Trihedron reuses orientation and projection matrix. It additionally makes matrix translation vectors equal to zero. Such an approach leads to loosing trihedron on the screen for perspective projection.
Normally, reuse of projection matrix for perspective projection would lead to perspective distortion of z-buffer Trihedron, which might differ for different locations of trihedron on the screen.
To evade unwanted distortion and steel keep perspective look of trihedron, it probably needs simply additional call of gl_viewport.
As seen on attached image correct perspective trihedron remains axes orientation and only have shrank line lengths relative to orthographic mode. While distorted trihedron do not represent actual view transformation.
Another possible solution is to leave trihedron to have only ortho projection as it may be seen in some commercial products.
Normally, reuse of projection matrix for perspective projection would lead to perspective distortion of z-buffer Trihedron, which might differ for different locations of trihedron on the screen.
To evade unwanted distortion and steel keep perspective look of trihedron, it probably needs simply additional call of gl_viewport.
As seen on attached image correct perspective trihedron remains axes orientation and only have shrank line lengths relative to orthographic mode. While distorted trihedron do not represent actual view transformation.
Another possible solution is to leave trihedron to have only ortho projection as it may be seen in some commercial products.
Steps to reproduce
pload VISUALIZATION pload MODELING vinit vgrid r l vzbufftrihedron vzoom 10 box b 0 -50 0 10 20 30 vdisplay b vsetdispmode b 1 vchangecamera proj persp vzoom 10
Public activity
41 archived notes
Participants are labeled by their role within this record.
Dear kgv,
Could you please review current solution?
Considering all arguments I decided to always use ortho projection for trihedron. Code is in branch CR24291.
Could you please review current solution?
Considering all arguments I decided to always use ortho projection for trihedron. Code is in branch CR24291.
I don't think that proposed solution provides natural results.
I agree that it would be better to show trihedron with axes directed in accordance with the local co-ordinate axes at the point where trihedron is located on the picture (i.e. "distorted"), even if it is an object living separately from the rest of the scene. After all, its purpose is to show directions of main axes of global CS. Naturally, the option can be provided allowing the user to choose either "perspective" or "axonometric" trihedron.
Dear duv,
I consider fixing general transformation persistence stuff at first step and then remove trihedron-specific computations by general logic.
Please see vsettransmode command and bug23120 (it seems bug23120_1 is exactly the same test and should be removed).
I consider fixing general transformation persistence stuff at first step and then remove trihedron-specific computations by general logic.
Please see vsettransmode command and bug23120 (it seems bug23120_1 is exactly the same test and should be removed).
pload MODELING pload VISUALIZATION box b1 10 20 30 vinit vdisplay b1 vsettransmode b1 32 0 0 -1 -1 0 vsetdispmode b1 1 vchangecamera proj persp
Dear all,
Please have a look at Attachment 1 (PNG) attached. Snapshot was taken using a third-party 3D visualization tool which is quite successful. Thus I believe both options are acceptable.
I downgrade the priority of this issue to low, not to distract resources from far more important issue #24001.
And I fully agree to rewrite z-buffered trihedron using common rendering scheme, rather than some highly specific sequence of OpenGL calls.
Please have a look at Attachment 1 (PNG) attached. Snapshot was taken using a third-party 3D visualization tool which is quite successful. Thus I believe both options are acceptable.
I downgrade the priority of this issue to low, not to distract resources from far more important issue #24001.
And I fully agree to rewrite z-buffered trihedron using common rendering scheme, rather than some highly specific sequence of OpenGL calls.
Requirement from #0024461 should be also considered, if possible.
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 17:46:22 2016 +0300
Refactoring
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - Z-buffer trihedron is lost when switching to perspective projection
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 17:46:22 2016 +0300
Refactoring
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - Z-buffer trihedron is lost when switching to perspective projection
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Rebase on the branch CR22582_4.
Dear Kirill,
please review the branch CR24291.
please review the branch CR24291.
Note that unlike ColorScale, it is desired to keep V3d_View property for displaying static trihedron object - since it is widely used functionality and unnecessary complication of porting should be avoided.
Thus, presentation builder should be moved to general-purpose packages (Prs3d/StdPrs) and re-used in V3d-View and AIS_Trihedron.
Thus, presentation builder should be moved to general-purpose packages (Prs3d/StdPrs) and re-used in V3d-View and AIS_Trihedron.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - Z-buffer trihedron is lost when switching to perspective projection
Remove the next methods from Graphic3d_CView: TriedronDisplay, TriedronErase, ZBufferTriedronSetup, TriedronEcho.
Delete OpenGl_Trihedron class.
Add a new class V3d_Trihedron.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - Z-buffer trihedron is lost when switching to perspective projection
Remove the next methods from Graphic3d_CView: TriedronDisplay, TriedronErase, ZBufferTriedronSetup, TriedronEcho.
Delete OpenGl_Trihedron class.
Add a new class V3d_Trihedron.
Dear Kirill,
Please review the branch CR24291_1.
Please review the branch CR24291_1.
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Oct 12 11:58:30 2016 +0300
Fix remarks by Kirill.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Oct 12 11:58:30 2016 +0300
Fix remarks by Kirill.
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Oct 12 15:00:45 2016 +0300
Drop redundant code
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Oct 12 15:00:45 2016 +0300
Drop redundant code
Branch [archived branch] has been created by Participant.
[revision removed]
No new revisions were added by this update.
[revision removed]
No new revisions were added by this update.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Thu Oct 13 12:41:43 2016 +0300
Fix remarks by Kirill.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Thu Oct 13 12:41:43 2016 +0300
Fix remarks by Kirill.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Kirill,
please review the branch CR24291_2.
please review the branch CR24291_2.
Branch [archived branch] has been updated by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu Oct 13 23:27:50 2016 +0300
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
V3d_Trihedron - do not create structure before display.
Define single-view Graphic3d_ViewAffinity directly.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu Oct 13 23:27:50 2016 +0300
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
V3d_Trihedron - do not create structure before display.
Define single-view Graphic3d_ViewAffinity directly.
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
The following methods have been removed from Graphic3d_CView class:
TriedronDisplay(), TriedronErase(), ZBufferTriedronSetup(), TriedronEcho().
New class V3d_Trihedron has been added as replacement of removed OpenGl_Trihedron
which now uses Graphic3d_TMF_TriedronPers persistence.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
The following methods have been removed from Graphic3d_CView class:
TriedronDisplay(), TriedronErase(), ZBufferTriedronSetup(), TriedronEcho().
New class V3d_Trihedron has been added as replacement of removed OpenGl_Trihedron
which now uses Graphic3d_TMF_TriedronPers persistence.
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Please test the patch in branches CR24291_3 (OCCT and Products).
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branches CR24291_3 from occt and products git-repositories have been rebased on the current masters
Dear Commenter 2,
Branch CR24291_3 from occt git-repository (and CR24291_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1170
Regressions/Differences:
http://occt-tests/CR24291_3-CR24291_3-OCCT/Debian70-64/summary.html
http://occt-tests/CR24291_3-CR24291_3-OCCT/Windows-64-VC10/summary.html
bugs vis bug71, bug23225, bug25500, bug26424
Testing on Linux:
occt component:
Total MEMORY difference: 90392248 / 90569079 [-0.20%]
Total CPU difference: 19432.209999999977 / 19463.759999999937 [-0.16%]
products component:
Total MEMORY difference: 30090956 / 30069397 [+0.07%]
Total CPU difference: 5316.359999999972 / 5271.849999999968 [+0.84%]
Testing on Windows:
occt component:
Total MEMORY difference: 57222500 / 57250244 [-0.05%]
Total CPU difference: 17921.379279898712 / 18101.186032498666 [-0.99%]
products component:
Total MEMORY difference: 21302043 / 21265221 [+0.17%]
Total CPU difference: 5104.586721499955 / 5148.189000999964 [-0.85%]
There are differences in images found by testdiff:
http://occt-tests/CR24291_3-CR24291_3-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR24291_3-CR24291_3-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
v3d glsl msaa
v3d glsl tiles
v3d raytrace bug24819
bugs vis bug71
bugs vis bug26434
Branch CR24291_3 from occt git-repository (and CR24291_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1170
Regressions/Differences:
http://occt-tests/CR24291_3-CR24291_3-OCCT/Debian70-64/summary.html
http://occt-tests/CR24291_3-CR24291_3-OCCT/Windows-64-VC10/summary.html
bugs vis bug71, bug23225, bug25500, bug26424
Testing on Linux:
occt component:
Total MEMORY difference: 90392248 / 90569079 [-0.20%]
Total CPU difference: 19432.209999999977 / 19463.759999999937 [-0.16%]
products component:
Total MEMORY difference: 30090956 / 30069397 [+0.07%]
Total CPU difference: 5316.359999999972 / 5271.849999999968 [+0.84%]
Testing on Windows:
occt component:
Total MEMORY difference: 57222500 / 57250244 [-0.05%]
Total CPU difference: 17921.379279898712 / 18101.186032498666 [-0.99%]
products component:
Total MEMORY difference: 21302043 / 21265221 [+0.17%]
Total CPU difference: 5104.586721499955 / 5148.189000999964 [-0.85%]
There are differences in images found by testdiff:
http://occt-tests/CR24291_3-CR24291_3-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR24291_3-CR24291_3-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
v3d glsl msaa
v3d glsl tiles
v3d raytrace bug24819
bugs vis bug71
bugs vis bug26434
Dear Kirill,
Branches CR24291_3 from occt and products het-repositories have been rejected due to:
- regressions/differences/improvements
- differences in images
Branches CR24291_3 from occt and products het-repositories have been rejected due to:
- regressions/differences/improvements
- differences in images
Branch [archived branch] has been updated by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Mon Oct 17 17:18:58 2016 +0300
V3d_Trihedron - declare arrows default colors to Red/Green/Blue.
Enable dummy texture mapping to disable environment texture map.
V3d_Trihedron::TrihedronStructure has been defined for handling device lost.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Mon Oct 17 17:18:58 2016 +0300
V3d_Trihedron - declare arrows default colors to Red/Green/Blue.
Enable dummy texture mapping to disable environment texture map.
V3d_Trihedron::TrihedronStructure has been defined for handling device lost.
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
The following methods have been removed from Graphic3d_CView class:
TriedronDisplay(), TriedronErase(), ZBufferTriedronSetup(), TriedronEcho().
New class V3d_Trihedron has been added as replacement of removed OpenGl_Trihedron
which now uses Graphic3d_TMF_TriedronPers persistence.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Jul 8 15:01:08 2016 +0300
0024291: Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed.
The following methods have been removed from Graphic3d_CView class:
TriedronDisplay(), TriedronErase(), ZBufferTriedronSetup(), TriedronEcho().
New class V3d_Trihedron has been added as replacement of removed OpenGl_Trihedron
which now uses Graphic3d_TMF_TriedronPers persistence.
Please test updated patch in branch CR24291_4.
Sorry, a couple of test cases should be updated.
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Please test the patch.
Dear Commenter 2,
Branch CR24291_4 from occt git-repository (and CR24291_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1133
Regressions/Differences:
Not detected
Testing on Linux:
occt component:
Total MEMORY difference: 90307296 / 90561844 [-0.28%]
Total CPU difference: 19484.48000000003 / 19463.559999999936 [+0.11%]
products component:
Total MEMORY difference: 30075861 / 30069397 [+0.02%]
Total CPU difference: 5323.709999999971 / 5271.849999999968 [+0.98%]
Testing on Windows:
occt component:
Total MEMORY difference: 57216554 / 57243619 [-0.05%]
Total CPU difference: 17947.727848798633 / 18100.624428898667 [-0.84%]
products component:
Total MEMORY difference: 21302040 / 21265221 [+0.17%]
Total CPU difference: 5084.47819259995 / 5148.189000999964 [-1.24%]
Branch CR24291_4 from occt git-repository (and CR24291_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1133
Regressions/Differences:
Not detected
Testing on Linux:
occt component:
Total MEMORY difference: 90307296 / 90561844 [-0.28%]
Total CPU difference: 19484.48000000003 / 19463.559999999936 [+0.11%]
products component:
Total MEMORY difference: 30075861 / 30069397 [+0.02%]
Total CPU difference: 5323.709999999971 / 5271.849999999968 [+0.98%]
Testing on Windows:
occt component:
Total MEMORY difference: 57216554 / 57243619 [-0.05%]
Total CPU difference: 17947.727848798633 / 18100.624428898667 [-0.84%]
products component:
Total MEMORY difference: 21302040 / 21265221 [+0.17%]
Total CPU difference: 5084.47819259995 / 5148.189000999964 [-1.24%]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Related records
- #0024461 · related to · closedRestore the possibility for the zBuffer trto move automatically to a predefined postion when going outside the view
- #0028035 · parent of · closedVisualization - V3d_Trihedron::compute() endlessly creates new graphic groups
- #0031547 · parent of · closedVisualization - V3d_View creates V3d_Trihedron instance
- #0007928 · related to · closedForum 7411: Improved display lists management for the trihedron display
- #0021358 · related to · closedVisualization - transform persistence and interactive selection
- #0023028 · related to · closedVisualization, TKOpenGl - eliminate global static variables
- #0026641 · related to · closedVisualization, TKOpenGl - handle correctly transformation persistence within perspective projection
- #0027816 · related to · closedVisualization - provide an API for overriding clipping planes list
- #0027947 · related to · closedThere are no way to set font name for Triedron
- #0027958 · related to · closedVisualization, AIS_Trihedron - add shaded presentation option