Zoom persistence and AIS_Trihedron


I'm having troubles with AIS_Trihedron + zoom persistence. I don't understand clearly how to make it work.

I display an AIS_Trihedron located at some gp_Ax2 placement, this is working fine.

Now to make that 3d object size "independent" from view zooming :

                    new Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, anchorPoint));

What point should I give as the "anchor point" ?

I've tried to tweak also with AIS_Trihedron::SetLocalTransformation() but always getting something wrong.

Please can someone help here ?



Matthias K.'s picture

The anchor point should be the position of the AIS_Trihedron, which is gp_Ax2::Location() you defined before.

Hugues Delorme's picture

Hello Matthias,

Thanks for answering, actually I solved that issue some days ago like this :

const gp_Ax2 placement = /* ... */;
gp_Trsf trsf;
trsf.SetDisplacement(gp::XOY(), gp_Ax3(gp::Origin(), placement.Direction(), placement.XDirection()));
aisTrihedron->SetTransformPersistence(new Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, placement.Location());