简体   繁体   中英

How can I selectively render VTK PolyData without deleting points or lines

I have a pipeline for rendering a PolyData. The PolyData consists of points and lines only (specifically no faces). I have normals for the points which would allow me to do some point based version of backface culling but I can't see how I can apply some sort of Filter to the pipeline to hide these nodes. I'd like to do this so that I can pan, tilt and scroll the view using an interactor without having to rebuild the PolyData.

It seems like this ought to be possible. Can someone direct me at the appopriate part of the API docs?

You can look at vtkClipPolyData filter. It clips the cells of the PolyData. So it will work for lines in your PolyData. If you want to make it work for the points as well then your points need to be stored as vtkVertex cells in your PolyData. vtkVertexGlyphFilter can be used to create a vtkVertex for every point in your PolyData. Looking at this post it seems that backface culling is not possible for lines even if the points have normals.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM