# How to rotate a cylindrical distance field?

**URL:** <https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint\
**Created:** [November 2, 2022, 7:13am UTC](https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239 "2022-11-02T07:13:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [November 2, 2022, 7:13am UTC](https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239/1 "2022-11-02T07:13:12Z")

</div>

I need the height of the cylinder to be on the vertical axis. However by default the height appears on the horizontal axes. I tried a few things but didn’t get the result I wanted

 ![DF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/1/101300fd83f73455e02c5513a817aae0c9f26e48.jpeg)

How can I do it?  
Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [November 2, 2022, 8:54am UTC](https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239/2 "2022-11-02T08:54:12Z")

</div>

I found a way to rotate the cylinder… I really don’t know if it’s a correct way to do it or if it can cause problems… I discovered it by chance… I would like someone with experience to confirm if it is a correct way to do it or not.

 ![Rot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/c/08c37137740c2e0a60798b260e9a1783475304ec.jpeg)

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [November 2, 2022, 11:40am UTC](https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239/3 "2022-11-02T11:40:47Z")

</div>

it does not work well… ☹

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [November 2, 2022, 7:42pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-cylindrical-distance-field/682239/4 "2022-11-02T19:42:32Z")

</div>

Ok, I have already managed to rotate and translate the distance field of cylindrical.

 ![casi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/0/b007f1d2e04f81d86830891c3dc06a3d86f21b6e.jpeg)

I got a part of the code in this post:

> [@Rotator -\> Transform3x3Matrix -\> BoxMask-3D (Rotations reversed!)](https://forums.unrealengine.com/t/rotator-transform3x3matrix-boxmask-3d-rotations-reversed/224097/2):
>
> Instead of using a Transform3x3Matrix, you can do it a bit more manually with a bit of math. The screenshot below shows how I did it.

And the other part of the code I got in this other post:

> [@Making a cylindrical mask instead of sphere](https://forums.unrealengine.com/t/making-a-cylindrical-mask-instead-of-sphere/316473/4):
>
> I made the cylinder distance field from above into a material network that you can copy. What this does is return a distance field for a the world. This is set up so that “height” also scales worldposition. To scale the cylinder, multiply worldposition by something first. To offset it, add something. Here is that material applied to a few static mesh planes. You can see how each plane shows a cross section of where it intersections the cylinder function. I…

However and although my main problem is already solved. I consider that the code is not yet complete.

That is, the following is missing:  
-Choose the radius of the cylinder  
-Modify the scale of the cylinder.

If someone is good at image vector math maybe I can post here how to do it.  
Because I’m very very newbie… I’ve been looking for the solution to this problem all day. 🥴

Thank you very much!!
