unwanted clipping

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: 
Luc Wens's picture

Could be the clipping by the camera: check Graphic3d_Camera::SetZRange.
You can get the camera from V3d_View::Camera()

Adrian Helcman's picture

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

Kirill Gavrilov's picture

but AIS_InteractiveContext::UpdateCurrentViewer(), under not clear conditions, resets the clipping back to the small values

V3d_View performs automated Z-fit calculations by default, which is done based on bounding box of a scene (see Visual3d_View::SetAutoZFitMode()).

(notice: i use oc6.9.1.)

If you are using that old version of OCCT, then you might just struggle upon a bug fixed long time ago.

Adrian Helcman's picture

hello kirill,

the solution with Visual3d_View::SetAutoZFitMode() usage is great.
thank you.

best regards,
adrian

Kirill Gavrilov's picture

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.

pload MODELING VISUALIZATION
box b 100 10 10
vinit View1
vdisplay -dispMode 1 b
vfit
vzoom 0.25
#vmanipulator m -attach b
vlocation b -translate 10 0 0
vlocation b -translate 10 0 0
vlocation b -translate 10 0 0
vlocation b -translate 10 0 0