[vtkusers] transparency of cells

Affolter Martin martin.affolter at ntb.ch
Tue Apr 12 11:37:04 EDT 2011


David,

thanks for your reply. I will try this in a small test-application and see how it works for us.

Regards,
Martin 


-----Ursprüngliche Nachricht-----
Von: David Gobbi [mailto:david.gobbi at gmail.com] 
Gesendet: Montag, 11. April 2011 14:32
An: Affolter Martin
Cc: VTK Users
Betreff: Re: [vtkusers] transparency of cells

The answer is yes, you can assign transparency to individual cells
by using RGBA cell scalars, i.e. one scalar value per cell.  The
vtkCellPicker can provide the CellId of the picked cell, and this
CellId can be used to index into the scalars and modify the alpha
of the scalar that corresponds to that cell.  Note that changing the
scalar values will not change the MTime of the data, so you must
call Modified on the data to get it to re-render.

If you use a single actor, the cell picking should be much faster
than it was when you were using multiple actors in VTK 4.  You
can accelerate the picking further by creating a cell locator for your
data and passing it to the picker.

 - David


On Mon, Apr 11, 2011 at 12:59 AM, Affolter Martin
<martin.affolter at ntb.ch> wrote:
> Hello
>
> I wonder if it is possible to change the transparency of individual cells within an actor? Has anyone done this before?
>
> I understand that it is possible to assign different colors per cell (color table) and of course to pick cells with the vtkCellPicker. The reason I'm asking is that we're planning to switch from vtk 4.4 to 5.6, which is only possible if we achieve a decent rendering performance. This can only be done by reducing the number of actors, as suggested by several members of this mailing-list. However, I have to make sure that our interaction-requirements are still fulfilled.
>
> Regards,
>
> Martin Affolter
>
> Interstaatliche Hochschule für Technik Buchs NTB
> Institut für Ingenieurinformatik
> NTB Campus Waldau St.Gallen
> Schönauweg 4 / Postfach
> 9013 St. Gallen
> Tel. ++41 81 755 32 49
> Fax  ++41 81 755 32 01
>
> http://institute.ntb.ch/inf.html



More information about the vtkusers mailing list