# Velocity vector as a quiver3d in ParaView

**URL:** https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296
**Category:** ParaView Support
**Created:** [July 25, 2019, 11:18am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296 "2019-07-25T11:18:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Misha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/misha/32/1732_2.png) [@Misha](https://discourse.paraview.org/u/Misha)
#### Post date: [July 25, 2019, 11:18am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/1 "2019-07-25T11:18:51Z")

</div>

Hi,

I found a way to create a quiver3d representation of the velocity field in ParaView using the regular Gliph filter. I changed the Gliph Mode to Every Nth Point (and change the Stride) or all points. I used the 2d Gliph arrow.  
I have a couple of questions:  
1.Is there a way to use a custom image for the 2d gliphs?  
2. I tried to take the quiver figure from Matlab, wrap it as a texture on the object and compare the results. They looked similar but not 100 percent the same.  
Does someone have any idea why?

Thank you in advance,  
Misha

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 25, 2019, 11:36am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/2 "2019-07-25T11:36:33Z")

</div>

> 1.Is there a way to use a custom image for the 2d gliphs?

Yes, with a custom dataset, not a custom image. Use the GlyphWithCustomSource filter instead.

> 1. I tried to take the quiver figure from Matlab, wrap it as a texture on the object and compare the results. They looked similar but not 100 percent the same.

Can you share an image of the difference ?

---

<div class="post-metadata">

### Author: ![Misha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/misha/32/1732_2.png) [@Misha](https://discourse.paraview.org/u/Misha)
#### Post date: [July 25, 2019, 11:57am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/3 "2019-07-25T11:57:38Z")

</div>

It seems that the Gliph arrow generate arrows in the XYZ directions even though the data is in spherical coordinates. Is there a way to show the arrows in spherical coordinates?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 25, 2019, 11:58am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/4 "2019-07-25T11:58:26Z")

</div>

You will have to convert your spherical coordinates verctors into cartesian coordinates first.

---

<div class="post-metadata">

### Author: ![Misha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/misha/32/1732_2.png) [@Misha](https://discourse.paraview.org/u/Misha)
#### Post date: [July 25, 2019, 3:47pm UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/5 "2019-07-25T15:47:32Z")

</div>

I tried using the following equation that was taken from:

> **[Spherical coordinate system](https://en.wikipedia.org/wiki/Spherical_coordinate_system)**
>
> In mathematics, a spherical coordinate system is a coordinate system for three-dimensional space where the position of a point is specified by three numbers: the radial distance of that point from a fixed origin, its polar angle measured from a fixed zenith direction, and the azimuth angle of its orthogonal projection on a reference plane that passes through the origin and is orthogonal to the zenith, measured from a fixed reference direction on that plane. It can be seen as the three-dimension...

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/63a9bcd5a4b96e82f16387c22c8bc52f4f7ca006.png)

U\*(R_sin(Lat_(3.14159265/ 180))_cos(Lon_(3.14159265/ 180))_iHat+R_sin(Lat\*(3.14159265/ 180))_sin(Lon_(3.14159265/ 180))_jHat+R_cos(Lat\*(3.14159265/ 180))_kHat)+V_(R_sin(Lat_(3.14159265/ 180))_cos(Lon_(3.14159265/ 180))_iHat+R_sin(Lat\*(3.14159265/ 180))_sin(Lon_(3.14159265/ 180))_jHat+R_cos(Lat\*(3.14159265/ 180))\*kHat)

(by the way, I am not sure why there is no Pi in the calculator, and if the units there are in radians or in degrees)

However, this didn’t produce good results with the Gliphs. Even when I checked the box “Coordinate Results”.

Thank you for your help,  
Misha

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 26, 2019, 7:37am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/6 "2019-07-26T07:37:27Z")

</div>

We indeed should have Pi in the calculator, @wascott opened an issue :  
[https://gitlab.kitware.com/paraview/paraview/issues/19210](https://gitlab.kitware.com/paraview/paraview/issues/19210)

Units are in radians, we could improve the doc, feel free to open an issue to improve it.  
[https://gitlab.kitware.com/paraview/paraview/issues](https://gitlab.kitware.com/paraview/paraview/issues)

You should not check the box “Coordinate Results” as only your vector is in spherical coordinates, not your points.

Please share your dataset.

---

<div class="post-metadata">

### Author: ![Misha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/misha/32/1732_2.png) [@Misha](https://discourse.paraview.org/u/Misha)
#### Post date: [July 28, 2019, 7:26am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/7 "2019-07-28T07:26:18Z")

</div>

Hi Mathieu,

Thank you very much for your response.

The dataset is the same as in my previous question:

> [@Quiver (Matlab) in ParaView](https://discourse.paraview.org/t/quiver-matlab-in-paraview/2238):
>
> Hi, I am trying to plot a velocity vector around a sphere, similar to Quiver in Matlab. Is there a way to do that? I have the U and V components. I tried to use the calculator filter and wrote : UiHat+VjHat. After that, I used the Gliph filter, but the gliphs were incorrect. Thanks, Misha

I’m sorry but I didn’t understand your answer.  
The points are in spherical coordinates and my vector is also in spherical coordinates.  
Maybe I missed a Spherical Calculator Filter for spherical objects?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 31, 2019, 8:15am UTC](https://discourse.paraview.org/t/velocity-vector-as-a-quiver3d-in-paraview/2296/8 "2019-07-31T08:15:31Z")

</div>

There is nothing like that. You will have to figure out the conversion into cartesian coordinates.
