Draw XYZ-axis in the corner of view window

Is there an easy way to add XYZ-axis in the corner of view window?


Timo Roth's picture

To control displaying of "thick" colored trihedron you may use the following methods of V3d_View class:


Here is an example of C++ code suitable for insertion into MFC method void CSampleView::OnInitialUpdate():


For a simpler trihedron you can choose V3d_WIREFRAME instead of V3d_ZBUFFER as last parameter to TriedronDisplay. Then ZBufferTriedronSetup() should not be necessary.

Kind regards,

James Blackmon's picture

Thanks a lot, Timo.

James Blackmon's picture

Hi, Timo:

I did see beautiful 3-color triedron, but the weird thing is, when I pan the object in the view, triedron will follow.

Any advices?

Timo Roth's picture

This behaviour was fixed in the maintenance release 6.3.1 of Open Cascade.
So, either you contact OCC company to get this release.
Or you wait for the public release of OCC 6.4 in December 2010.
Or you look at http://sourceforge.net/projects/opencascade/files/
There is also a Fix (fix235) for this problem.
It says in readme.txt:
- Summary: Incorrect placement of ZBuffer trihedron
- Detailed description: OpenGl_triedron.c used weird check isWithinView and correctly placed ZBuffer trihedron only when the model went out of the view. Fix ignores this check. Sergey Anikin claimed this must have been fixed in 6.3.1.


jelle's picture

"Wait for half a year to get a fix for a solved problem"
I do not know whether to laugh or weep when I read this.

James Blackmon's picture

Thank you so much, Timo. You are so kind. I will get fix from Sourceforge.