0

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?

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Dave Durbin
  • 3,562
  • 23
  • 33

1 Answers1

0

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.

  • Thanks for the reply. I could see a way to use this but only with the scalar data option and only if I were able to compute dot products of each point's normal with the point-camera vector prior to executing this filter but I'm not sure how I can do that. I would have to have some other filter in between the PolyData and the `vtkClipPolyData` filter which computes scalar dot products per vertex. Is that what you had in mind ? – Dave Durbin Sep 09 '18 at 04:10
  • My experience with `vtkClipPolyData` is in Paraview when I try to visualize spherical point clouds and I want to cut the cloud into hemispheres using a plane. So it is not really an occlusion culling like you want. I haven't use the clipping by a scalar option yet. There is `vtkCuller` class that you can use to write your own culler. But I don't know a lot about it. –  Sep 09 '18 at 18:35
  • Also, `vtkMath` class provides dot products and other math operations but it is not really a filter. –  Sep 09 '18 at 18:37