visualize large amount of changing object(cubes, points, lines, etc) in real time

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:

  1. receive all these data and render them in vtk
  2. render them >=20 frames per second
  3. 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 :

  1. Use vtkPoints + vtkVertexGlyphFilter to render point cloud. When points change, I just modify the vtkPoints and call Modify(). This method seems work well.
  2. 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:

  1. 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?
  2. 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.
  3. Is there any better solution?
  4. Should I use another 3d engine? Does vtk meet my needs?

Thanks

You can show different kind of object based on an index.

https://vtk.org/doc/nightly/html/classvtkGlyph3DMapper.html#a4c497fc8bd5ec3911e1a131e34a8ecf4

Thanks for your reply. I have more questions:

  1. So can I use only one actor to render different kinds of object with different pos / orientation / color / scale?
  2. If in that manner, how can I pick or select one of the object by mouse?

So can I use only one actor to render different kinds of object with different pos / orientation / color / scale?

Yes

If in that manner, how can I pick or select one of the object by mouse?

you should be able to recover information about the picked object (its index) and identify it this way

So can I use only one actor to render different kinds of object with different pos / orientation / color / scale?

Can you provide some key word or web link about this technique? If it works, then you save my life.

If in that manner, how can I pick or select one of the object by mouse?

Which component can I use to do the picking? Yes, I’ll do the rest , for example change the picked object’s color, show a 2D information, etc.

https://vtk.org/doc/nightly/html/classvtkGlyph3DMapper.html#ade773b8a991ce35c0e758dd624acec88

Here is how to do it for scaling