problem with colors and redhat 9
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
bug in vtk-4.3.0-1.cvs20030620
When I run the following script under win xp, there is no problem. But under linux, I've got a grey scale render instead of a coloured one.
import vtk reader = vtk.vtkUnstructuredGridReader() reader.SetFileName('./essai.vtk') reader.Update() lut1 = vtk.vtkLookupTable() lut1.SetHueRange(0.667, 0.0) dataMapper = vtk.vtkDataSetMapper() dataMapper.SetLookupTable(lut1) dataMapper.SetInput(reader.GetOutput()) drange = reader.GetOutput().GetScalarRange() dmin = drange[0] dmax = drange[1] dataMapper.SetScalarRange(1.2, 2.5) dataActor = vtk.vtkActor() dataActor.SetMapper(dataMapper) ren = vtk.vtkRenderer() ren.AddActor(dataActor) ren.SetBackground(1,1,1) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(500, 500) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) iren.Initialize() iren.Start()
And the file essai.vtk :
vtk DataFile Version 3.0
2D scalar data ASCII
DATASET UNSTRUCTURED_GRID POINTS 8 float 0 0 2 1 0 2 1 1 2 0 1 2 2 0 2 3 0 2 3 1 2 2 1 2
CELLS 6 24 3 0 1 2 3 0 2 3 3 1 4 2 3 4 7 2 3 4 5 7 3 5 6 7
CELL_TYPES 6 5 5 5 5 5 5
POINT_DATA 8 SCALARS temperature float 1 LOOKUP_TABLE default 1.0 2.0 2.0 1.0 3.0 4.0 4.0 3.0