# Rotating a cubemap

**URL:** <https://forums.unrealengine.com/t/rotating-a-cubemap/385072>\
**Category:** Community & Industry Discussion\
**Tags:** cubemap, Sky, rotator, rotation, unreal-engine, question\
**Created:** [February 16, 2017, 5:52am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072 "2017-02-16T05:52:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_16db5cc7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_16db5cc7](https://forums.unrealengine.com/u/anonymous_user_16db5cc7)\
**Post date:** [February 16, 2017, 5:52am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/1 "2017-02-16T05:52:08Z")

</div>

Hi!

I’m trying to rotate a spheremap using RotateAboutAxis but all it does is spiraling the sky rather than rotating it. It basically pins pixels around rotation axis. I know it would be much easier to use world position offset pin but I rather avoid rotating actual geometry. I want to rotate it dynamically in two different axises for stars simulation.

Some screenshots:

 ![126473-snip1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/7/ac7def2b151499ebc2abb35ca6d1906ca50f60c5.png)

 ![126474-snip2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/1/5d1ab5c4a4f68fd6d2321fee9ab34bc07c08c36d.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0c62419a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0c62419a](https://forums.unrealengine.com/u/anonymous_user_0c62419a)\
**Post date:** [February 16, 2017, 6:58pm UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/2 "2017-02-16T18:58:08Z")

</div>

Hey Talkativeone,

This is how I would go about rotating the cubemap.

 ![126597-rotcubemap.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/5/e55b343b032aced755431e6c2aba5169650ac18c.jpeg)

Let me know if that helps!

Ed

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_16db5cc7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_16db5cc7](https://forums.unrealengine.com/u/anonymous_user_16db5cc7)\
**Post date:** [February 17, 2017, 5:28am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/3 "2017-02-17T05:28:13Z")

</div>

Hi

Thank you so much, this works perfectly! However, there is one more thing I can’t figure out. I’m trying to add two rotations to each other now (I want to expose pitch and yaw of the sky to BP). I did a few tests but I can’t quite get it to work (it skews the skybox rather than rotate as soon as I try to add input from second rotation axis. I think DEFNIQUE had a problem similar in nature but I can’t quite follow Ryan’s instructions here: [Combining Rotations (RotateAboutAxis) for World Position ffset - Rendering - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?106445-Combining-Rotations-(RotateAboutAxis)-for-World-Position-ffset)

Any help on that would be much appreciated!  
T.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0c62419a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0c62419a](https://forums.unrealengine.com/u/anonymous_user_0c62419a)\
**Post date:** [March 6, 2017, 10:22pm UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/4 "2017-03-06T22:22:22Z")

</div>

Hi sorry for the late reply, for some reason my queue didn’t update with your response. Anyway, what exactly are you trying to do? Could you describe the effect you are going for.

Depending on what you are doing I may suggest masking off part of the sphere OR using a lerp node.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_16db5cc7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_16db5cc7](https://forums.unrealengine.com/u/anonymous_user_16db5cc7)\
**Post date:** [March 8, 2017, 2:16am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/5 "2017-03-08T02:16:01Z")

</div>

Hi

No worries, I’m still struggling with it. My cubemap is a full star sky. I want to rotate it in two axis to accurately simulate Earth’s night sky rotation based on geographical latitude via blueprint. Therefore, I need pitch and yaw of the rotation. I think rotating the pixels is the only solution as rotating the sky in world position (actual vertices) would not suit my setup (my clouds use uv coordinates)

, T.

---

<div class="post-metadata">

**Author:** ![Fisher007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fisher007](https://forums.unrealengine.com/u/Fisher007)\
**Post date:** [September 25, 2021, 11:19am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/6 "2021-09-25T11:19:21Z")

</div>

You can have multiple axes mixed while rotating with this setup.

 ![349316-2021-09-25-13-04-50-cuberotate.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/f/9efe628f42fabbc1ba54746be352bf0c1f4c96d0.jpeg)

---

<div class="post-metadata">

**Author:** ![IngwarVonLohmann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IngwarVonLohmann](https://forums.unrealengine.com/u/IngwarVonLohmann)\
**Post date:** [February 3, 2023, 8:17am UTC](https://forums.unrealengine.com/t/rotating-a-cubemap/385072/7 "2023-02-03T08:17:56Z")

</div>

Please see discussion here, I posted correct answer there

> [@Combining Rotations (RotateAboutAxis) for World Position ffset](https://forums.unrealengine.com/t/combining-rotations-rotateaboutaxis-for-world-position-ffset/60241/1):
>
> I’m trying to do something like a camera facing displacement. I cannot use screen coordinates for this. The solution I came up with is to rotate the Absolute World Position so the model faces forward set up and apply the displacement then rotate the model back. I’m using RotateAboutAxis, which works fine for one rotation but when I try to combine rotations the things get haywire (skew). Is there a way to combine rotations or a better solution than what I’ve come up with? Edit: So it seems using…
