# Drawing a collection of variable length fixed radius cylinders

**URL:** https://discourse.vtk.org/t/drawing-a-collection-of-variable-length-fixed-radius-cylinders/1602
**Category:** Support
**Created:** [August 18, 2019, 3:10am UTC](https://discourse.vtk.org/t/drawing-a-collection-of-variable-length-fixed-radius-cylinders/1602 "2019-08-18T03:10:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![noamb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/noamb/32/10700_2.png) [@noamb](https://discourse.vtk.org/u/noamb)
#### Post date: [August 18, 2019, 3:10am UTC](https://discourse.vtk.org/t/drawing-a-collection-of-variable-length-fixed-radius-cylinders/1602/1 "2019-08-18T03:10:46Z")

</div>

I want to draw a collection of variable length fixed radius fixed color cylinders, and I want to be able to pick them. I’ve been trying to do it via glyphs, but each glyph object type I’ve tried fails in a different way. Does anyone have any suggestions for how to achieve this efficiently, i.e. without creating a separate actor for each cylinder?

Is it possible to have a vtkGlyph3D where the orientation and scaling (by vector components) of each glyph is set arbitrarily? I understand how to associate one scalar and one vector with each point, but as far as I can tell I need two - one for the orientation, one for the scaling. I see examples for color + orientation, for example, but those all seem to use one scalar and one vector.

I can achieve what I want graphically with vtkTensorGlyph (because the orientation and the scaling are in the same coordinate system), but then I can’t figure out how to pick glyphs. With vtkGlyph3D There’s GetPointIds, but not, as far as I can tell, with vtkTensorGlyph.

---

<div class="post-metadata">

### Author: ![noamb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/noamb/32/10700_2.png) [@noamb](https://discourse.vtk.org/u/noamb)
#### Post date: [August 19, 2019, 11:43am UTC](https://discourse.vtk.org/t/drawing-a-collection-of-variable-length-fixed-radius-cylinders/1602/2 "2019-08-19T11:43:08Z")

</div>

Answering my own question (should this be an edit?), it looks like vtkGlyph3DMapper can do what I need, at least in terms of the graphical output, since it easily lets you set separate vector arrays for orientation and scale by name. I haven’t quite figured out picking, but I’ll follow up if/when I do.

---

<div class="post-metadata">

### Author: ![noamb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/noamb/32/10700_2.png) [@noamb](https://discourse.vtk.org/u/noamb)
#### Post date: [August 30, 2019, 2:12pm UTC](https://discourse.vtk.org/t/drawing-a-collection-of-variable-length-fixed-radius-cylinders/1602/3 "2019-08-30T14:12:47Z")

</div>

Never did get picking to work with vtkGlyph3DMapper. Switched to vtkProgrmmableGlyphFilter, and that’s acceptable for now (except for an inability to set color directly, not through a lookup table).
