Hi, I’m creating a visualization tool using vtk to visualize sensor’s data in self driving car. For now, I need to render 100000+ points and 2000+ objects (consist of cube, arrow, lines, etc), the points / objects position, size and color are determined by many external laser sensor or user’s algorithms.
For exmaple:
user’s algorithm 1: want to show A1 cubes, B1 lines, … (Each frame, the numbers of cubes, lines… are changing. And the position / orientation / size are also changing)
user’s algorithm 2: want to show B2 lines, C2 arrows, D2 points
user’s algorithm 3: want to show C3 points, D3 cubes
…
My goal is:
- receive all these data and render them in vtk
- render them >=20 frames per second
- I can easily show / hide parts of input. For example, I can easily hide A1 cubes from algorithm1 when user click a button.
For now, I meet a performance problem. My solution is :
- Use vtkPoints + vtkVertexGlyphFilter to render point cloud. When points change, I just modify the vtkPoints and call Modify(). This method seems work well.
- For each object, make a source / a mapper and a actor. For example, if user need to show 2000 cubes, then I create 2000 vtkCubeSource and mapper and actor. This method is very slow. Create 2000 actors is slow and render is also very slow.
My question:
- I find some possible solution like how to render 10000 actors, but using vtkGlyph3DMapper can only render one kind of object. So if I want to render different kind of objects (like cubes, lines, arrows), do I need to create several vtkGlyph3DMapper for each of them? For example, one vtkGlyph3DMapper to render all cubes, one vtkGlyph3DMapper to render all lines?
- If I use the method above, how can I manage them? Because as I describled before, the cubes I need to visualize may provided by several algorithm, and I need to realize a function that I can easily hide/ show part of them.
- Is there any better solution?
- Should I use another 3d engine? Does vtk meet my needs?
Thanks