Mon, 09/27/2021 - 17:33
Forums:
hello,
the problem description:
attached image shows the situation, when animated moving of object along the x-axis (po_Context->SetLocation (poAISShape, o_Trafo);) leads to unwanted effect of clipping. V3d_View object contains no clipping planes. when the scene is redrawn (it is enough to move the cursor above the object to force the outlines redrawing), the clipping disappears.
thanks for any advice.
best regards,
adrian
Attachments:
Mon, 09/27/2021 - 19:13
Could be the clipping by the camera: check Graphic3d_Camera::SetZRange.
You can get the camera from V3d_View::Camera()
Tue, 09/28/2021 - 13:47
hello luc,
at first, thank you very much for your answer.
yes, SetZRange helps, but AIS_InteractiveContext::UpdateCurrentViewer(), under not clear conditions, resets the clipping back to the small values:
Camera()->ZNear() == myvalue
AIS_InteractiveContext::UpdateCurrentViewer()
Camera()->ZNear() != myvalue
(there is no other code in between.)
when i check this change and call SetZRange again when it appears, the animation works without problems.
(notice: i use oc6.9.1.)
best regards,
adrian
Tue, 09/28/2021 - 17:12
V3d_View performs automated Z-fit calculations by default, which is done based on bounding box of a scene (see Visual3d_View::SetAutoZFitMode()).
If you are using that old version of OCCT, then you might just struggle upon a bug fixed long time ago.
Wed, 09/29/2021 - 10:00
hello kirill,
the solution with Visual3d_View::SetAutoZFitMode() usage is great.
thank you.
best regards,
adrian
Mon, 09/27/2021 - 20:28
I don't think that provided details would be enough to locate your problem - that shouldn't happen in a normal case if viewer content is properly redrawn after setting object location. So more code of your animation routine would be helpful.