[vtkusers] Make a texture transparent

Rémy Baudet baudet at ondim.fr
Mon Mar 11 12:35:52 EST 2002


Hi,
 
I'd like to make a plane with a texture transparent, but using
vtkProperty::SetOpacity() has no effect on the texture opacity.
Thanks for your help.
 

vtkBMPReader * pReader = vtkBMPReader::New();
pReader->SetFileName(pElement->getTopoFile().data());
 
vtkTexture * pTex = vtkTexture::New();
pTex->SetInput(pReader->GetOutput());
pTex->InterpolateOn();
 
vtkPlaneSource * pPlane = vtkPlaneSource::New();
vtkPolyDataMapper * pPlaneMapper = vtkPolyDataMapper::New();
pPlaneMapper->SetInput(pPlane->GetOutput());
 
vtkActor * pPlaneActor = vtkActor::New();
pPlaneActor->SetMapper(pPlaneMapper);
pPlaneActor->SetTexture(pTex);
pPlaneActor->GetProperty()->SetOpacity(5.0);
 
 
 
Rémy Baudet
ONDIM - Signal | Image | Multimédia
Email : baudet at ondim.fr
Tél. : +33.1.40.33.88.08
Fax : +33.1.40.33.65.54
Adresse : 14, rue du Soleillet - 75020 Paris
 




More information about the vtkusers mailing list