[vtkusers] About Volume Rendering in VTK

Lisa Avila lisa.avila at kitware.com
Tue Feb 22 13:50:52 EST 2005

Hello Juan,

The vtkUnstructuredGridVolumeRayCastMapper works on the scalars in your 
data - either point data or cell data or you can point it to some field 
data. These are the methods you need to look at:

   // Description:
   // Control how the filter works with scalar point data and cell attribute
   // data.  By default (ScalarModeToDefault), the filter will use point data,
   // and if no point data is available, then cell data is used. Alternatively
   // you can explicitly set the filter to use point data
   // (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData).
   // You can also choose to get the scalars from an array in point field
   // data (ScalarModeToUsePointFieldData) or cell field data
   // (ScalarModeToUseCellFieldData).  If scalars are coming from a field
   // data array, you must call SelectColorArray before you call
   // GetColors.
   void SetScalarModeToDefault() {
   void SetScalarModeToUsePointData() {
   void SetScalarModeToUseCellData() {
   void SetScalarModeToUsePointFieldData() {
   void SetScalarModeToUseCellFieldData() {

   // Description:
   // When ScalarMode is set to UsePointFileData or UseCellFieldData,
   // you can specify which array to use for coloring using these methods.
   // The transfer function in the vtkVolumeProperty (attached to the calling
   // vtkVolume) will decide how to convert vectors to colors.
   virtual void SelectScalarArray(int arrayNum);
   virtual void SelectScalarArray(const char* arrayName);

   // Description:
   // Get the array name or number and component to color by.
   virtual char* GetArrayName() { return this->ArrayName; }
   virtual int GetArrayId() { return this->ArrayId; }
   virtual int GetArrayAccessMode() { return this->ArrayAccessMode; }

   // Description:
   // Return the method for obtaining scalar data.
   const char *GetScalarModeAsString();


At 06:33 PM 2/16/2005, Juan José Aja Fernández wrote:
>I've posted a couple of questions about volume rendering, but I guess
>they were too generic so I'm going to make it simple.
>I want to volume render an unstructured grid, so I guess I should use
>vtkUnstructuredGridVolumeRayCastFunction and Mapper.
>What I want to know is: What do I need to do this?
>I gues I will need a couple of points and voxels to define the grid.
>What else? Point Data or Cell Data?
>What I'm trying to say is: How does vtk does the volume rendering in
>unstructured grids? Does it work on the scalars of the grid?, or does
>it work on the point/cell Data?.
>Thanks in advance.
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>Follow this link to subscribe/unsubscribe:

More information about the vtkusers mailing list