# Cesium Origin Shift

**URL:** <https://community.cesium.com/t/cesium-origin-shift/31378>\
**Category:** Cesium for Unreal\
**Created:** [April 11, 2024, 9:26am UTC](https://community.cesium.com/t/cesium-origin-shift/31378 "2024-04-11T09:26:28Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 11, 2024, 9:26am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/1 "2024-04-11T09:26:28Z")

</div>

Hi,

I’m using Cesium for Unreal to create a global flight simulator - I’m doing this by loading a tileset from disk. I have been attempting to use the orign shift component on the aircraft due to the issue described [here](https://community.cesium.com/t/ue5-floating-point-precision-jitter-with-lat-lon-doubles/20531) which appears Epic are still yet to fix.

The origin shift component removes the jitter from the aircraft as intended but it also seems to cause my terrain to slightly jump around each time the orign shift is performed. This is not a big issue when flying at altitude, but when flying low to the ground (coming in for landing, for example) it is extremely distracting and borderline unusable as a simulator.

A temporary fix I came up with was a blueprint that would move the georeference to the centre of a runway when X meters away from that point - something similar may have been able to have been achieved with sub levels. However, this still doesn’t solve the issue when low-level flying e.g. flying the machloop in Wales.

I’m unsure what else to try at this point and whether this may be an issue with my terrain, I’ve seen others on this forum describe creating projects similar to mine but they don’t appear to have run into this issue - see [Lildreas](https://community.cesium.com/u/Lildreas) in the forum post describing floating point jitter. I also don’t really want to start modifying the engine as suggested in some of the links within that post.

Many thanks!

---

<div class="post-metadata">

**Author:** ![azrogers](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/azrogers/32/21672_2.png) [@azrogers](https://community.cesium.com/u/azrogers)\
**Post date:** [April 11, 2024, 6:39pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/2 "2024-04-11T18:39:19Z")

</div>

Hi @SimonLation! Sorry to hear about the issue you’re experiencing. Can you tell us what version of Unreal and Cesium for Unreal are you using, to help us track down the bug?

On the point of your temporary fix, you should be able to achieve something similar using the Distance property on the CesiumOriginShiftComponent. But, of course, it would be better to solve the underlying issue here.

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 12, 2024, 11:25am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/3 "2024-04-12T11:25:34Z")

</div>

Hi @azrogers, I’m using UE 5.3 with Cesium 2.4.0.

I tried using the distance mode of the origin shift component, however, I found that doing so would sometimes mean that an origin shift still takes place when close (or on) the runway. Using the solution I came up with meant that an origin shift never takes place when close to the runway.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Richard\_Hawley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/richard_hawley/32/20190_2.png) [@Richard\_Hawley](https://community.cesium.com/u/Richard_Hawley)\
**Post date:** [April 17, 2024, 9:03am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/4 "2024-04-17T09:03:55Z")

</div>

I have a peculiar interaction happening while using CesiumOriginShift on a Pawn that uses JSBSimMovementComponent (which uses the Unreal GeoReferencingSystem component set with the same geo co-ordinates as the CesiumGeoreference component). When the origin shift occurs, the terrain goes flying away.

Does anyone have any advice on what might be going on and how to setup these components so I only need one georeference object?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [April 19, 2024, 9:03pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/5 "2024-04-19T21:03:41Z")

</div>

Hi @Richard_Hawley, welcome to the community!

Personally I’ve never used the JSBSimMovementComponent, but in general, Cesium doesn’t automatically sync with the Unreal georeferencing plugin. Still, you can write a Blueprint that manually syncs the Cesium georeference with the Unreal one every frame. There are methods on CesiumGeoreference that can help with this purpose, notably **Get Origin Longitude Latitude Height** and **Set Origin Longitude Latitude Height**.

![image](https://global.discourse-cdn.com/cesium/original/3X/5/1/511c96af8147f984059350213ded870f806e8ce5.png)

Let us know if that solution works for you!

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 23, 2024, 12:14pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/6 "2024-04-23T12:14:09Z")

</div>

Any suggestions or confirmation you can replicate on your side @janine @azrogers?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [April 24, 2024, 3:02pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/7 "2024-04-24T15:02:38Z")

</div>

Hi @SimonLation, I’m so sorry we missed your original response.

It’s true that `CesiumOriginShift` will continually shift the georeference, and therefore move everything geolocated in the scene. But since everything is shifted, those movements should effectively cancel out and still result in a seamless experience. So the fact that you’re seeing those jitters is strange indeed.

Can you share the following information so we can try to understand what’s going on?

- What data are you using – Cesium World Terrain, or your own data?
- Does setting the **Mobility** flag on your terrain to **Moveable** make a difference?
- What does the CesiumGlobeAnchor on your aircraft look like? Is the **Teleport when Updating Transform** setting enabled?

We’ll try to troubleshoot from there. If none of those settings make a difference, I’m not sure how much we can advise other than by looking at the contents of your scene. We may have to ask for a minimal sample project, or at least the aircraft Blueprint, for testing purposes. (You can send it via private message if you’d like).

Thank you again for your patience 🙏

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 24, 2024, 4:14pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/8 "2024-04-24T16:14:23Z")

</div>

Hi @janine, no problem.

- I’m using my own data
- The terrain is set to moveable
- The globe anchor has the that setting enabled.

I’ve done some further testing. I’m using the DynamicPawn so movement is controlled manually rather than by the data that was being fed in, but the terrain still has the jitter.

I’m unsure if jitter is the correct way to describe it, the terrain just visibly moves ever so slightly when the shift happens - sometimes it is more noticeable for no apparent reason. Are you able to replicate this on your side by flying the dynamic pawn close to the terrain?

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 26, 2024, 10:43am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/9 "2024-04-26T10:43:45Z")

</div>

@janine Using Unreal 5.4 has fixed the mesh jitter issue I was experiencing. I’m still having the same issue with origin shift causing the terrain to move around when rebasing though. This is not a big of a deal breaker as it previously was since I can increase the distance at which a rebase will take place. I would still like to get to the bottom of this though.

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 26, 2024, 11:57am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/10 "2024-04-26T11:57:34Z")

</div>

Tried using CesiumWorldTerrain which doesn’t seem to have the same terrain issue as when I use my own local tileset - could this be an issue with the tileset?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [April 26, 2024, 6:07pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/11 "2024-04-26T18:07:04Z")

</div>

Hi @SimonLation, thank you for sharing more detail with me. I’m glad to hear that Unreal 5.4 fixed your mesh jittering!

Hm, I wonder if there are some differences between Cesium World Terrain and your dataset that are particularly important. It might help to share more information, but I also want to respect the privacy of your data. If this gives you any ideas: Cesium World Terrain is streamed in [quantized-mesh](https://github.com/CesiumGS/quantized-mesh) format, and we position everything in Cesium based on the WGS84 ellipsoid. Perhaps this is different from what your data expects?

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 30, 2024, 9:38am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/12 "2024-04-30T09:38:28Z")

</div>

I believe my terrain is in 3D Tiles format, not quantized mesh. Positioning is done using the same cooridnate system (ESPG:4797 I believe). Do you happen to have a known “good” 3DTiles tileset and/or a quantized-mesh version?

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [April 30, 2024, 9:45am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/13 "2024-04-30T09:45:31Z")

</div>

@janine Thanks to @ILoveFlan’s post I have found that setting the georeference mode to “True Origin” removes the jumpiness of the terrain. The tooltip for this mode notes that it is not recommended but not why, I assume this would not be recommended due to accuracy?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [May 1, 2024, 5:40pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/14 "2024-05-01T17:40:05Z")

</div>

Hi @SimonLation,

> I believe my terrain is in 3D Tiles format, not quantized mesh. Positioning is done using the same cooridnate system (ESPG:4797 I believe). Do you happen to have a known “good” 3DTiles tileset and/or a quantized-mesh version?

Thanks for sharing. Cesium World Terrain is in quantized-mesh, which I _believe_ is projected with  
EPSG:4326. For another point of comparison, Google Photorealistic 3D Tiles is streamed as purely 3D Tiles (even the terrain). I hope those two datasets can offer points of comparison.

> Thanks to @ILoveFlan’s post I have found that setting the georeference mode to “True Origin” removes the jumpiness of the terrain. The tooltip for this mode notes that it is not recommended but not why, I assume this would not be recommended due to accuracy?

That’s a really interesting find. Let me take a step back…

The purpose of `CesiumGeoreference` is to georeference the Unreal level, i.e. to assign the Unreal origin (0, 0, 0) to some specified point on the globe. Combined with `CesiumOriginShift`, you can move around the world, and the origin will consistently rebase to your position, so you have seamless roaming without worrying about stuff like the changing up-direction across the globe.

In “True Origin” mode, you are instead positioning the Unreal origin (0, 0, 0), at whatever the _tileset’s origin_ is. It is usually not recommended because for many tilesets, e.g., global terrain tilesets, the tileset’s origin is the center of the Earth. So you’re essentially georeferencing the level to the center of the Earth, instead of a point on the Earth’s surface. `CesiumOriginShift` isn’t relevant here.

I’m not sure why “True Origin” would work better for your case, especially if your objects are globe-anchored underneath that same georeference. I guess that would be one thing to check, if _everything_ in your world is geolocated by the same georeference actor.

But based on your feedback, it sounds like there’s some disagreement with the data and the plugin. I couldn’t tell you what without looking more closely, but I hope this explanation helps.

---

<div class="post-metadata">

**Author:** ![ILoveFlan](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/iloveflan/32/14037_2.png) [@ILoveFlan](https://community.cesium.com/u/ILoveFlan)\
**Post date:** [May 6, 2024, 6:47pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/15 "2024-05-06T18:47:19Z")

</div>

Hi @janine,

> In “True Origin” mode, you are instead positioning the Unreal origin (0, 0, 0), at whatever the _tileset’s origin_ is. It is usually not recommended because for many tilesets, e.g., global terrain tilesets, the tileset’s origin is the center of the Earth. So you’re essentially georeferencing the level to the center of the Earth, instead of a point on the Earth’s surface. `CesiumOriginShift` isn’t relevant here.

What is the behavior if we use “True Origin” and Origin Shift Component set to “Change Cesium Georeference”? Would we not be updating to the correct z up? When testing it does seem like I am remaining on the globe’s surface as expected, however, I have not tested working with collisions and physics to verify this.

---

<div class="post-metadata">

**Author:** ![SimonLation](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@SimonLation](https://community.cesium.com/u/SimonLation)\
**Post date:** [May 9, 2024, 9:23am UTC](https://community.cesium.com/t/cesium-origin-shift/31378/16 "2024-05-09T09:23:20Z")

</div>

Hi @janine, thank you for the extended explanation - the Google tiles also do not have this problem so I agree with you that it’s most likely a disagreement between my data and the plugin.

I can send you a sample of the terrain I am using but would rather do this over PM if possible.

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [May 10, 2024, 3:49pm UTC](https://community.cesium.com/t/cesium-origin-shift/31378/17 "2024-05-10T15:49:33Z")

</div>

Hi @ILoveFlan,

> What is the behavior if we use “True Origin” and Origin Shift Component set to “Change Cesium Georeference”? Would we not be updating to the correct z up? When testing it does seem like I am remaining on the globe’s surface as expected, however, I have not tested working with collisions and physics to verify this.

These two settings are fundamentally incompatible with each other. With **True Origin** , you’re fixing the **CesiumGeoreference** to the origin of the tileset. It doesn’t make sense to then try and move the origin, because then it’s not going to be at the center of the tileset, which would invalidate the **True Origin** setting. That might not be helpful for your use case. 😅
