# Setting each glyph opacity and representation

**URL:** https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666
**Category:** Support
**Created:** [April 29, 2021, 6:59pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666 "2021-04-29T18:59:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sboogert](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sboogert](https://discourse.vtk.org/u/sboogert)
#### Post date: [April 29, 2021, 6:59pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666/1 "2021-04-29T18:59:53Z")

</div>

I have a large vtkPolyData set that I visualize with vtkTensorGlyph. Is it possible to change the opacity and representation (wireframe/surface) for each glyph independently? I suppose in a simiilar way that each glyph can be independently coloured using vtkTensorGlyph::SetColorModeToScalars();

I can imagine this is impossible given rendering pipeline, z-buffering etc.

---

<div class="post-metadata">

### Author: ![dmreagan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dmreagan/32/7489_2.png) [@dmreagan](https://discourse.vtk.org/u/dmreagan)
#### Post date: [May 4, 2021, 4:16pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666/2 "2021-05-04T16:16:43Z")

</div>

You may be able to change opacity by [enabling opacity mapping](https://vtk.org/doc/nightly/html//classvtkDiscretizableColorTransferFunction.html#ac8e677da67774e1d8d15801e4b5122bd). I haven’t used this feature in VTK, but [it works in ParaView](https://docs.paraview.org/en/latest/ReferenceManual/colorMapping.html#mapping-data).

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 4, 2021, 4:41pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666/3 "2021-05-04T16:41:00Z")

</div>

It works in VTK, too. You can control color, opacity, size, select glyph shape, etc. by specifying point data arrays.

---

<div class="post-metadata">

### Author: ![sboogert](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sboogert](https://discourse.vtk.org/u/sboogert)
#### Post date: [May 13, 2021, 2:59pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666/4 "2021-05-13T14:59:17Z")

</div>

So I’ve been trying with no luck to RGB colour each vtkTensorGlyph. Giving an appropriate scalar array to the polydata only appears to use the first component of the 3 tuple.

This was quite straight forward for vtk3DGlyph and vtk3DGlyphMapper but not at all obvious for vtkTensorGlyph.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 13, 2021, 3:03pm UTC](https://discourse.vtk.org/t/setting-each-glyph-opacity-and-representation/5666/5 "2021-05-13T15:03:21Z")

</div>

There are several glyphing filters/mappers with slightly different feature sets. If you find the vtkTensorGlyph works well for you and the only limitation is that it only supports RGB and not RGBA then you may consider implementing this small extra feature and contribute back to VTK.
