# Glyph with Custom Source orientation

**URL:** https://discourse.paraview.org/t/glyph-with-custom-source-orientation/151
**Category:** ParaView Support
**Created:** [June 11, 2018, 4:29pm UTC](https://discourse.paraview.org/t/glyph-with-custom-source-orientation/151 "2018-06-11T16:29:38Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [January 3, 2019, 7:06pm UTC](https://discourse.paraview.org/t/glyph-with-custom-source-orientation/151/4 "2019-01-03T19:06:19Z")

</div>

> [@insley](#):
>
> More specifically, I want to rotate each glyph a different amount around a given axis (in this case the same axis for every glyph, just at different angles)? Is there a way to do this?

ParaView does not have an orientation mode that does this in either the **Glyph** filter or **Glyph with Custom Source** filter. With the exception of the Box glyph and the 2D glyphs, there is an assumption that the glyph is radially symmetric about the x-axis, so the transformation that rotates the glyphs to line up with a vector may induce a rotation about the glyph’s axis that is assumed not to matter.

However, the **3D Glyphs** representation may let you rotate about a specific axis if you set the _Orientation Mode_ property to _Rotation_. In that mode, the vector array will specify a rotation about each of the X, Y, or Z axes.

> [@insley](#):
>
> I want to apply a texture to my custom glyph. And for each glyph I’d like to randomly select the texture that gets used from a list of textures. I suspect I could easily have the programmable filter randomly pick the texture, but does the filter get executed for each glyph?

Thinking about this, it should be possible, but it is a bit involved. Only one texture can be applied to a polygonal data set in ParaView at a time. You could do a trick where you pack different textures into a single texture and then adjust the texture coordinates applied to each glyph to get the effect you are looking for You’ll need to have some 2d texture coordinates defined in a custom glyph, and then transform the texture coordinates for each glyph so that they map into the different textures you’ve packed into one.

Now, how do you transform the texture coordinates randomly for each glyph? The **Programmable Filter** will be run once for the entire output of the **Glyph with Custom Source** filter, so you’ll need to process all glyphs in one execution of the filter. To assign texture coordinates randomly, the filter will need to know something like a “glyph ID” and then map that ID to a texture coordinate transform. You could generate a random mapping ahead of time from “glyph ID” to texture transform and then use that map while processing each point in the glyphed data. The **Glyph with Custom Source** filter does not produce a “glyph ID” field, but you could apply the **Connectivity** filter to obtain effectively an ID for each glyph in an array called _RegionId_, and then apply the **Programmable Filter** to that (so your pipeline would be **Glyph with Custom Source** ➡ **Connectivity** ➡ **Programmable Filter** ).

So, it’s likely possible, but not necessarily straightforward.

---

_[View the full topic](https://discourse.paraview.org/t/glyph-with-custom-source-orientation/151)._
