<div>Hi vtkUsers,</div>
<div>I&#39;m trying to volume render with&nbsp;vtkUnstructuredGrid mappers, but can not make it completely opaque.</div>
<div>I can make it more trasparent though&nbsp;by changing the settings of the&nbsp;opacityTransferFunction.</div>
<div>But setting point values at 1.0 does not make it completely&nbsp;opaque.</div>
<div>None of other listed below&nbsp;vtkUnstructuredGrid mappers help.</div>
<div>vtkUnstructuredGridVolumeRayCastMapper<br>vtkProjectedTetrahedraMapper<br>vtkUnstructuredGridVolumeZSweepMapper</div>
<div>&nbsp;</div>
<div>The python code is below.</div>
<div>What I&#39;m missing?</div>
<div>Thanks for help,</div>
<div>Vlad</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<p>import vtk</p>
<p>ren1 = vtk.vtkRenderer()<br>renWin = vtk.vtkRenderWindow()<br>renWin.AddRenderer(ren1)<br>iren = vtk.vtkRenderWindowInteractor()<br>iren.SetRenderWindow(renWin)</p>
<p>pts = vtk.vtkStructuredPoints()<br>pts.SetDimensions(2,2,2)<br>scalars = vtk.vtkUnsignedCharArray()<br>scalars.SetNumberOfComponents(1)<br>for x in range(8):<br>&nbsp;scalars.InsertValue(x, 100)<br>pts.GetPointData().SetScalars(scalars)
</p>
<p>trifilter = vtk.vtkDataSetTriangleFilter()<br>trifilter.SetInput(pts)</p>
<p># Create transfer mapping scalar value to opacity<br>opacityTransferFunction = vtk.vtkPiecewiseFunction()<br>opacityTransferFunction.AddPoint(0,&nbsp;&nbsp; 1.0)<br>opacityTransferFunction.AddPoint(255,&nbsp;&nbsp; 1.0)</p>
<p># Create transfer mapping scalar value to color<br>colorTransferFunction = vtk.vtkColorTransferFunction()<br>colorTransferFunction.AddRGBPoint(0.0,&nbsp;&nbsp; 0.0, 0.0, 1.0)<br>colorTransferFunction.AddRGBPoint(127.0, 0.0, 1.0
, 0.0)<br>colorTransferFunction.AddRGBPoint(255.0, 1.0, 0.0, 0.0)<br>&nbsp;<br>volumeProperty = vtk.vtkVolumeProperty()<br>volumeProperty.SetColor(colorTransferFunction)<br>volumeProperty.SetScalarOpacity(opacityTransferFunction)
</p>
<p># Neither one of the 3 mappers below help to make the cube opaque<br>volumeMapper = vtk.vtkUnstructuredGridVolumeRayCastMapper()<br>##volumeMapper = vtk.vtkProjectedTetrahedraMapper()<br>##volumeMapper = vtk.vtkUnstructuredGridVolumeZSweepMapper
()<br>volumeMapper.SetInputConnection(trifilter.GetOutputPort())</p>
<p># The volume holds the mapper and the property and<br># can be used to position/orient the volume<br>volume = vtk.vtkVolume()<br>volume.SetMapper(volumeMapper)<br>volume.SetProperty(volumeProperty)</p>
<p>ren1.AddVolume(volume)<br>ren1.SetBackground(0.5,0.5,0.5)<br>renWin.SetSize(800,800)</p>
<p>iren.Initialize()<br>renWin.Render()<br>iren.Start()</p>
<p>&nbsp;</p></div>