# How do i rotate a 2D Liquid Simulation

**URL:** <https://forums.unrealengine.com/t/how-do-i-rotate-a-2d-liquid-simulation/561209>\
**Category:** FX\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [May 19, 2022, 3:58pm UTC](https://forums.unrealengine.com/t/how-do-i-rotate-a-2d-liquid-simulation/561209 "2022-05-19T15:58:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greebli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greebli](https://forums.unrealengine.com/u/Greebli)\
**Post date:** [May 19, 2022, 3:58pm UTC](https://forums.unrealengine.com/t/how-do-i-rotate-a-2d-liquid-simulation/561209/1 "2022-05-19T15:58:00Z")

</div>

i’ve been trying to rotate the “Grid 2D flip Hose” fluid simulation 90 degrees on x is there an easy way to do this?

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/0/fe0a1935d4cfe1a343116278d306f45a19289a38.png)  
_Grid 2D flip Hose example i’m trying to rotate on x 90_

Seems like i need to change a few things to get this to rotate I’m aware of that, this seems like a good place to start: Grid2D\_FLIP\_RasterizeParticles, right?

What are some key parameters i would need to change in the system to rotate it?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/3/2537c43964fe1933d9e4c93500ea339773791614.png)  
_Custom HLSL shaders in Grid2D\_FLIP\_RasterizeParticles_

Endgoal: run low res fluid sim over map to create simple wind simulation

Thanks for the help

---

<div class="post-metadata">

**Author:** ![darthviper107](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/darthviper107/32/710746_2.png) [@darthviper107](https://forums.unrealengine.com/u/darthviper107)\
**Post date:** [May 19, 2022, 5:22pm UTC](https://forums.unrealengine.com/t/how-do-i-rotate-a-2d-liquid-simulation/561209/2 "2022-05-19T17:22:19Z")

</div>

There might be some other stuff you need to make some changes to that we can’t see here but by you can try just swapping the Y and Z values, so in the first custom HLSL box you would swap the Y and Z values:

```auto
Grid_SetGridValue(XIndexInt, 0, YIndexInt, Velocity.x, IGNORE);
Grid_SetGridValue(XIndexInt, 1, YIndexInt, Velocity.y, IGNORE);

```

And do the same for the other custom HLSL box:

```auto
Grid_SetGridValue(XIndexInt*x, 0, YIndexInt*y, Weight*Velocity.x, IGNORE);
Grid_SetGridValue(XIndexInt*x, 1, YIndexInt*y, Weight*Velocity.y, IGNORE);

```

You might need to go to the other stuff that’s plugging into that and swap the Y and Z axis things as well

---

<div class="post-metadata">

**Author:** ![DevonPenney](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devonpenney/32/924223_2.png) [@DevonPenney](https://forums.unrealengine.com/u/DevonPenney)\
**Post date:** [May 20, 2022, 5:17am UTC](https://forums.unrealengine.com/t/how-do-i-rotate-a-2d-liquid-simulation/561209/3 "2022-05-20T05:17:50Z")

</div>

Try to do this without changing that rasterization code. The best way to start is assume you need to change the Grid 2D Create Unit To World transform rotation to be an axis and angle to quat. Orient the sprite for the sim plane how you want (you need to enable the disabled renderer in there to see it). After that, check ray trace on both Grid2D Rasterize Particles and Flip Particle Update. That should be a good starting place, but I’ll admit, the workflow is a bit tedious to get there. We’ll improve it over time.
