How to position the trihedron on V3d_ZBUFFER mode?

I use
"myView->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER);"
to display a trihedron. The trihedron is always on the center of the view, but it is correct when the last parameter is V3d_WIREFRAME.

Fotis Sioutis's picture

In case of V3d_ZBUFFER, the trihedron is always displayed at the origin if it is in the view.In case the origin is out of the view then the trihedron is displayed where you tell it.This is a feature and not a bug.You can easily modify the OCC TKOpengl source code , and change OpenGl_triedron.c call_zbuffer_triedron_redraw function.The check is done on

if (!isWithinView) {
/* Annulate translation matrix */

I believe now you can easily change the code to suit your needs.

With owner
Sioutis Fotis

Bill Chen's picture

Hello Sioutis, Thanks a lot!
I change the check to
if(TRUE){
/* Annulate translation matrix */
Is it right? The trihedron's position is right,but it moved when i rotate the view,is there any other to change to fit this?

Fotis Sioutis's picture

Well the correct change would be to discard the assigning of isWithinView (two lines upper) and replace with your own which will force it to be false.What you did does not work right because the isWithinView boolean is checked also later in the code in order to POP the GL_PROJECTION and GL_MODELVIEW matrixes which were PUSHED in the scope we modified.

Greetings
Sioutis Fotis

Bill Chen's picture

I have made it! Thanks a million!