[vtkusers] 3D regular scalar field visualisation

Artem Babayan artem.paraview at googlemail.com
Fri Apr 30 13:02:05 EDT 2010


Hello,

I am trying to visualize 3D scalar field defined on regular grid (i.e.
STRUCTURED_POINTS dataset). What I would like to get is a
semitransparent colored cloud. So far I did the following: read the
data -> pass them to vtkFixedPointVolumeRayCastMapper -> pass it to
actor -> pass it to renderer -> pass it to windows:

      //read the volume from file
      vtkSmartPointer<vtkStructuredPointsReader> reader_conc=
                      vtkSmartPointer<vtkStructuredPointsReader>::New();
      reader_conc->SetFileName("conc_3d.vtk");

      //Create a mapper
      vtkSmartPointer<vtkFixedPointVolumeRayCastMapper> mapper_conc =
                   vtkSmartPointer<vtkFixedPointVolumeRayCastMapper>::New();
      mapper_conc->SetInput(reader_conc->GetOutput());

      //Create an actor
      vtkSmartPointer<vtkVolume> actor_conc =
                              vtkSmartPointer<vtkVolume>::New();
      actor_conc->SetMapper(mapper_conc);

      // Create a rendered
      vtkSmartPointer<vtkRenderer> renderer =
                              vtkSmartPointer<vtkRenderer>::New();
      renderer->AddActor(actor_conc);

     <Add renderer to the window etc.>

But the results are not satisfactory -- all it shows is strange black
and white image. I guess, it is necessary to set some parameters for
the mapper? Which ones?

Best wishes
Artem



More information about the vtkusers mailing list