[vtkusers] Rendering large 2d numpy array as DEM with several level of details

gmas giumas at yahoo.it
Sun Sep 6 00:40:39 EDT 2015


I am struggling with a quite simple task. How can I implement several LODs
for rendering a 2D numpy array?

        w = 1585
        h = 1262
        np_array = np.random.random(w*h)
        data = vtk.vtkImageData()
        data.SetDimensions(w, h, 1)
        data.GetPointData().SetScalars(numpy_to_vtk(np_array, deep=True,
array_type=vtk.VTK_FLOAT))

        mapper = vtk.vtkDataSetMapper()
        mapper.ScalarVisibilityOn()  # set the visibility on the scalar
        mapper.SetScalarRange(data.GetPointData().GetArray(0).GetRange())
        mapper.SetInputData(data)
         
        actor = vtk.vtkLODProp3D()
        actor.AddLOD(mapper, 0.0)
        # actor.AddLOD(low_mapper, 0.0)  <<< How can I implement a
low-resolution mapper for vtkImageData??? 
        ren.AddViewProp(actor)

        vtk_widget.GetRenderWindow().Render()

I have not been able to find working examples. Which filters could be
applied?



--
View this message in context: http://vtk.1045678.n5.nabble.com/Rendering-large-2d-numpy-array-as-DEM-with-several-level-of-details-tp5733747.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list