Hi all
I am a beginner with VTK, it’s interesting and I’m currently learning through examples.
When I try the example of Delaunay2, I noticed that the points disappear when the camera is zoomed in to a certain extent
Is there any way to avoid the issue of points being covered and thus disappearing? I hope to see the points clearly at zoomed-in distances, just like their original appearance.
Any advice or suggestion would be great.
Those small squares are called glyphs in computer graphics lingo. They are rendered like little billboards (refer to how Doom monsters were rendered). Hence, they can be occluded by intervening geometry which is the expected behavior.
To change the default behavior, you can, for exemple, disable depth testing for them (see this: rendering 3d elements on top - Web - VTK) or add points’ actor (called pointActor in the Delaunay2 example) to a second foreground renderer (see this: Draw an actor always on top of the secene. - Support - VTK). A third solution may involve customizing the shaders of the points’ vtkPolyDataMapper.
@dgobbi good “point”, I’ll redo the example setting line and point sizes. I’ll also add a version for the new Pythonic API. They should appear in a few days. Colors and screen size will also change, and the points and lines ahould be visible even when zooming in. @blocky, something for the future: You can also add sliders to control line width and point size. Check out the examples using sliders if you are interested.
Here is the C++ code for the updated version: Delaunay2D.cxx (2.4 KB)
Both SetForceTranslucent(true) and using two layers for rendering can prevent points from disappearing. It’s cool! And if we want the points on the occluded surfaces in the mesh not to be displayed, we may need additional clipping. I will also try to customizing vtkPolyDataMapper. Thanks to Paulo for the idea!
RenderPointsAsSpheresOn indeed quickly resolves the occlusion issue, thanks for the update on the example!