[vtkusers] How to make the exterior of an image transparent?
Istvan Matis
i_matis at yahoo.de
Sun Jun 13 16:33:45 EDT 2004
Hi guys,
can somebody tell me how to make the exterior of an image transparent? I need only the "middle".
Thanks in advance!
Istvan Matis
Below is my code: -I tried to map an image on a plane as a texture. It will generate an error, that it couldn't find any scalar! What is that?
vtkPlaneSource * tPlaneSource=vtkPlaneSource::New();
vtkThresholdTextureCoords * thresh=vtkThresholdTextureCoords::New();
thresh->SetInput((vtkDataSet *)tPlaneSource->GetOutput());
thresh->ThresholdByUpper(0.5);
vtkDataSetMapper *tDataSetMapper_Plane=vtkDataSetMapper::New();
tDataSetMapper_Plane->SetInput(thresh->GetOutput());
vtkPolyData *temp=tPlaneSource->GetOutput();
tDataSetMapper_Plane->SetScalarRange(temp->GetScalarRange());
anActor_Reslice->SetMapper(tDataSetMapper_Plane);
vtkTexture * tTexture=vtkTexture::New();
tTexture->SetInput(anImageReslice-> GetOutput());
tTexture->InterpolateOn();
anActor_Reslice->SetTexture(tTexture); //nothing will happen, image will be "black", error will be generated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040613/51851364/attachment.htm>
More information about the vtkusers
mailing list