CMSM-VCU / zoo

Peridynamics data visualization tool
MIT License
0 stars 0 forks source link

Camera clipping range does not account for exaggeration #58

Open rileychall opened 12 months ago

rileychall commented 12 months ago

It appears that the camera clipping range (near and far clip planes) is automatically adjusted according to the camera position and the position of the drawn objects. However because the vertices are (potentially very significantly) displaced by exaggeration in the shader, the clipping range calculation does not take it into account. This is most apparent in cases with thin, flat objects under transverse deformation.

When is the clipping range calculated, and how can I override that? Would there be any relevant downside to just setting the clipping range to something huge? The VTK documentation for camera clipping range says the clipping range "can have a large impact on how well z-buffering works". Do we care?

rileychall commented 12 months ago

Pyvista appears to very frequently reset the camera clipping range. However, there is very conveniently the vtkRenderer.SetClippingRangeExpansion() method. That seems to do exactly what I need and pyvista doesn't touch it. However, the clipping range expansion is clamped to [0, 0.99], so I can't rely on it for extreme cases.

renderer.SetClippingRangeExpansion(0.99) would reduce the problem and be a trivial addition.