Hey all,

i am visualizing sensordata (x,y,z,sensorvalue) with a python vtk app.

When Rendering more then 10 million “Points” it gets very laggy.

Also when zooming out this is getting worse.

Is there a way to improve the rendering/visualizing ?

Maybe something like rendering half of the data when zooming in and more when zooming out.

Some Options in the renderer or the renderwindow/interactor that can speed up the mouse interaction (ratation,mooving…)

As i am pretty working myself into vtk, there may be some simple options i just dont know yet.

## Very Basic example of the code i am using right know (just the “important”):

lookUpTable_3d = vtk.vtkLookupTable()

vtkpoints_3d = vtk.vtkPoints()

vtkpoly = vtk.vtkPolyData()

vtkcells = vtk.vtkCellArray()

renderer = vtk.vtkRenderer()

renderWindowInteractor = vtk.RenderWindowInteractor()

renderWindowInteractor.AddRenderer(renderer)

mapper = vtk.vtkPolyDataMapper()

mapper.SetColorModeToDefault()

actor = vtk.vtkActor()

actor.SetMapper(mapper)

renderer.AddActor(actor)

renderWindowInteractor.Initialize()

renderWindowInteractor.Start()

cells_array_init = np.arange(len(viewer3d_sensor_coordinates)).reshape(len(viewer3d_sensor_coordinates), 1)

cells_array_set = np.repeat(cells_array_init, repeats=3, axis=1)

cells_npy = np.column_stack([np.full(len(viewer3d_sensor_coordinates), 3, dtype=np.int64), cells_array_set.astype(np.int64)]).ravel()

vtkcells.SetCells(len(viewer3d_sensor_coordinates), numpy_to_vtkIdTypeArray(cells_npy))

self.vtkcells.Modified()

vtkpoints_3d.SetData(numpy_to_vtk(viewer3d_sensor_coordinates))

vtkpoints_3d.Modified()

vtkpoly.SetPoints(vtkpoints_3d)

vtkpoly.SetVerts(vtkcells)

vtkpoly.Modified()

mapper.SetInputData(vtkpoly)

mapper.Modified()

setting up the lut … then:

viewer3d_color_2d = numpy_to_vtk(viewer3d_sensor_values)

vtkpoly.GetPointData().SetScalars(lookUpTable_3d.MapScalars(viewer3d_color_2d,vtk.VTK_COLOR_MODE_DEFAULT,-1))

vtkpoly.Modified()

renderer.Modified()

renderWindowInteractor.Render()