[vtkusers] VolumeRayCastMapper for a RectilinearGrid?

Bernard Giroux giroux at geo.polymtl.ca
Wed Dec 6 09:36:32 EST 2006


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

-- 
Bernard Giroux, ing., Ph.D.
Associé de recherche

http://geo.polymtl.ca/~giroux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3253 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061206/8f3c9c08/attachment.bin>


More information about the vtkusers mailing list