[vtkusers] superimpose vtkActor2D via opacity

Sascha Däuber daeuber at ira.uka.de
Fri Nov 10 11:11:41 EST 2000


Dear VTK-community!

We've been trying hard to superimpose two different vtkActors2D in a
vtkImageWindow. We tried to change the opacity of the vtkProperty2D. It
seems to be ignored. We specified the layer number of each Actor with no
success as well.

What we need that for is to superimpose two vtkImageData in one
vtkImageWindow by changing the opacity of the upper Actor2D.

Any comments or hints would be greatly appreciated.

Many thanks!

Sascha

Code:
[snipp usual code]
// preps
ren1->AddActor2D (my1st2DActor);
ren1->AddActor2D (my2nd2DActor);

// 1st try :
my1st2DActor->GetProperty()->SetOpacity(1)
my2nd2DActor->GetProperty()->SetOpacity(.01)
// 2nd actor visibly overlays the 1st one though its opacity is nearly zero

// 2nd try :
my1st2DActor->SetLayerNumber(2);
my2nd2DActor->SetLayerNumber(1);
// still no sight of my1st2DActor

// 3rd try
my1st2DActor->SetLayerNumber(1);
my2nd2DActor->SetLayerNumber(2);
// nop!





More information about the vtkusers mailing list