<html>
Hello Asad,<br>
<br>
I think you are doing something a bit too simple here. At least part of
the problem is that you have data of constant value and you are computing
gradients. The very first gradient will be high (because by default
values outside the volume are assumed to be 0) but the next one will have
zero magnitude (and hence no shading). Then you are using ray casting,
which is a sampling technique. So you have very high frequency data (only
the very first sample has a high gradient, the others have none) which
you are sampling inadequately - hence the banding. <br>
<br>
Try turning shading off and you should see a solid block.<br>
<br>
Lisa<br>
<br>
<br>
At 04:42 PM 6/14/00, Asad A. Abu-Tarif wrote:<br>
<blockquote type=cite cite><font size=2>Hi vtk users,</font><br>
<font size=2>I've been trying to render a vtkStructuredPoints data. The
scalars in that data set have a constant value of 100 (just for testing).
When I render the data set, I get interlaced black and white planes. The
code I'm using to render the data is attached. Can anyone tell me what
I'm doing wrong. </font><br>
<font size=2>I'm using the latest official release of VTK (3.12) with
VC++ version 6.0.</font><br>
 <br>
<font size=2>**If it is related: </font><br>
<font size=2>The data dimensions (100X100X100).</font><br>
<font size=2>My VGA card is Elsa Gloria II Pro with 64MB.</font><br>
<font size=2>I'm using Windows NT on a Dell workstation with 733Mhz
processor and 512 MB RDRAM.</font><br>
 <br>
<font size=2>Thanks,</font><br>
<font size=2>Asad</font><br>
 <br>
<font size=2>{Here is where I create the structured data set and fill it
with the constant 100.}</font><br>
 <br>
<font size=2>vtkPiecewiseFunction *oTFun =
vtkPiecewiseFunction::New();<br>
  // Get Opacity segments and add them.<br>
  oTFun->AddSegment(0,1.0,255,1.0);</font><br>
 <br>
<font size=2> // Create a transfer function mapping scalar value to
color (grey)<br>
 vtkPiecewiseFunction *cTFun = vtkPiecewiseFunction::New();<br>
  // Get Color segments and add them.<br>
  cTFun->AddSegment(0, 0.0, 255, 1.0);<br>
  <br>
   // Create a property for the volume and set the transfer
functions.<br>
  vtkVolumeProperty *volumeProperty = 
vtkVolumeProperty::New();<br>
  volumeProperty->SetColor(cTFun);<br>
  volumeProperty->SetScalarOpacity(oTFun);<br>
  volumeProperty->SetInterpolationTypeToLinear();<br>
  volumeProperty->ShadeOn();</font><br>
 <br>
<font size=2>   // Create a ray function - this is a
compositing ray function<br>
   vtkVolumeRayCastCompositeFunction *compositeFunction = 
<br>
  vtkVolumeRayCastCompositeFunction::New();</font><br>
 <br>
<font size=2>   // Create the volume mapper and set the ray
function and scalar input<br>
   vtkVolumeRayCastMapper *volumeMapper =
vtkVolumeRayCastMapper::New();<br>
  volumeMapper->SetInput(StructuredPoints);  //
StructuredPoints is my test vtkStructuredPoints data set.<br>
 
volumeMapper->SetVolumeRayCastFunction(compositeFunction);</font><br>
 <br>
<font size=2>   // Create the volume and set the mapper and
property<br>
   vtkVolume *volume = vtkVolume::New();<br>
  volume->SetMapper(volumeMapper);<br>
  volume->SetProperty(volumeProperty);</font><br>
 <br>
<font size=2>   // Add this volume to the renderer and get a
closer look<br>
   renderer->AddVolume(volume);</font></blockquote><br>
</html>