[vtkusers] Opacity and vtkColorTransferFunction

Wen-Hsing Chiang wchiang at iesinet.com
Fri Aug 15 17:20:09 EDT 2003


Lisa,
Thank you for the reply. I have found a solution to use vtkLookupTable.
I converted the scalar values to index in the same way as
vtkBandedPolyDataContourFilter::SetScalarModeToIndex(). The index values
are then map to vtkLookupTable. It works good now. 

Wen-Hsing Chiang, Ph.D.
Integrated Environmental Services, Inc.
20 Fairbanks, Suite 187
Irvine, CA 92618
USA
tel. 949.460.7003
fax. 949 460 7019



-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of Lisa Avila
Sent: Friday, August 15, 2003 2:12 PM
To: Wen-Hsing Chiang; vtkusers at vtk.org
Subject: Re: [vtkusers] Opacity and vtkColorTransferFunction


Hello Wen-Hsing,

vtkColorTransferFunction does not support opacity - all colors have
opacity 
of 1.0, which I believe overrides the opacity of the actor.

Lisa

At 03:22 PM 8/15/2003, Wen-Hsing Chiang wrote:
>Hi,
>I am getting a problem in making an actor translucent. The color of the

>actor is mapped to the scalar values by vtkColorTransferFunction. I 
>tried to set a rather small opacity value (0.1) to the actor, but it 
>remains opaque. The problem does not occur when using vtkLookupTable. 
>Since I need to map particular values to designated colors, 
>vtkLookupTable is not suitable.
>
>Here is the suedo code, can anyone tell me what is wrong? Thanks!
>
>vtkPolyData * pPolyData = vtkPolyData::New()
>//set up pPolyData here....
>
>vtkColorTransferFunction * pColorTransferFunction = 
>vtkColorTransferFunction::New(); for (int i = 0; i < m_iNumberOfColors;

>i++) {
>     pColorTransferFunction->AddRGBPoint(value[i], red[i], green[i],
>blue[i]);
>}
>// pColorTransferFunction->SetAlpha(0.1) does not work also!!
>
>vtkPolyDataMapper * pPolyDataMapper     = vtkPolyDataMapper::New();
>pPolyDataMapper->SetInput(pPolyData);
>pPolyDataMapper->SetLookupTable(pColorTransferFunction);
>
>vtkActor * pActor = vtkActor::New();
>pActor->SetMapper(pPolyDataMapper);
>pActor->GetProperty()->SetOpacity(.1);
>......
>
>
>
>Wen-Hsing Chiang, Ph.D.
>Integrated Environmental Services, Inc.
>20 Fairbanks, Suite 187
>Irvine, CA 92618
>USA
>tel. 949.460.7003
>fax. 949 460 7019
>
>************************** PRIVACY NOTICE ****************************
>
>The information contained in this communication is confidential and is 
>intended only for the individual or entity to whom it is addressed. Any

>unauthorized use, distribution, copying or disclosure of this 
>communication is prohibited.  If you have received this communication 
>in error, please contact the sender immediately using the reply mail 
>function and then delete the message.
>
>Thank you, Integrated Environmental Services, Inc. www.iesinet.com
>**********************************************************************
>
>
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers



_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list