[vtkusers] VolumeRayCastMapper for a RectilinearGrid?

Amy Squillacote amy.squillacote at kitware.com
Wed Dec 6 10:27:28 EST 2006


Hi Bernard,

VTK can volume render datasets of type vtkImageData or 
vtkUnstructedGrid. You'll need to convert your dataset to one of these 
two types if you want to raycast it.

- Amy

Bernard Giroux wrote:
> I cannot figure out how to use ray casting to render a 
> vtkRectilinearGrid.  Is there a mapper for this type vtkDataSet?
>
>
>
> The following java code yields the error message
>
> ERROR: In 
> /usr/local/vtk-5.0.2/VTK/VolumeRendering/vtkVolumeMapper.cxx, line 83
> vtkVolumeRayCastMapper (0x1f1423c0): The SetInput method of this 
> mapper requires vtkImageData as input
>
>
>
>
> private void buildDensityVtkVolume() {
>     updateOpacityTransferFunction();
>     updateColorTransferFunction();
>     vtkVolumeProperty volumeProperty = new vtkVolumeProperty();
>     volumeProperty.SetColor(colorTransferFunction);
>     volumeProperty.SetScalarOpacity(opacityTransferFunction);
>
>     vtkVolumeRayCastCompositeFunction compositeFunction = new 
> vtkVolumeRayCastCompositeFunction();
>     vtkVolumeRayCastMapper volumeMapper = new vtkVolumeRayCastMapper();
>     volumeMapper.SetVolumeRayCastFunction(compositeFunction);
>     volumeMapper.SetInput(BHGraviGUI.currentProject.getComplexEarthModel() 
>
>                 .getVtkDataSet());
>
>     densityVolume = new vtkVolume();
>     densityVolume.SetMapper(volumeMapper);
>     densityVolume.SetProperty(volumeProperty);
> }
>
> Here,
> BHGraviGUI.currentProject.getComplexEarthModel().getVtkDataSet()
>
> return a vtkRectilinearGrid
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



More information about the vtkusers mailing list