[vtkusers] transparency of cubes in voxel data (structured points)
Marc Niethammer
marcn at ece.gatech.edu
Wed Jan 2 17:41:03 EST 2002
Hi,
I would like to visualize voxel data, which is essentially binary (either
a voxel is set = 1, or not set = 0). However, the following code does not
make the black voxels transparent, so that I can see the faces of the
other voxels. Is there any way to prevent this from happening?
Thanks for any help.
-- Marc
%------
source vtkInt.tcl
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
vtkScalars sc
sc SetNumberOfScalars 8
sc SetScalar 0 0
sc SetScalar 1 1
sc SetScalar 2 1
sc SetScalar 3 1
sc SetScalar 4 1
sc SetScalar 5 1
sc SetScalar 6 1
sc SetScalar 7 1
vtkLookupTable layers
layers SetNumberOfColors 2
layers Build
layers SetTableValue 0 0.0 0.0 0.0 0.0
layers SetTableValue 1 1.0 0.0 0.0 1.0
vtkStructuredPoints sPts
sPts SetDimensions 3 3 3
[sPts GetCellData] SetScalars sc
vtkDataSetMapper mapperD
mapperD SetInput sPts
mapperD SetLookupTable layers
vtkActor vol
vol SetMapper mapperD
ren1 AddActor vol
renWin Render
iren SetUserMethod {wm deiconify .vtkInteract}
iren Initialize
wm withdraw .
%-------
More information about the vtkusers
mailing list