[vtkusers] Opacity and vtkColorTransferFunction
Lisa Avila
lisa.avila at kitware.com
Fri Aug 15 17:12:10 EDT 2003
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
More information about the vtkusers
mailing list