E4 coordinate conversion

Hello All,I have a problem. When I use cesium, I create a water body. It is not a static object. It is a component. The position is correct in the self built scene. After I package it, the position will shift. After my own verification, it is because the world origin will change. I want to know how to use the blue chart to change the coordinates of my object to the correct position. What formula do you need to usewater

Hello @11180,

I’ve run in to similar problems with water bodies. I’m not sure that adjusting the position of your object will help in this case. What I’ve seen happening is that the water will render in a location that isn’t where the object is actually located - the actual position never moves, but for some reason the water will just render somewhere else.

To check whether or not we are seeing the same issue, can you print the coordinates of the object when it is correctly placed and when it shifts? You can use GetActorLocation and InaccurateTransformUeToLongitudeLatitudeHeight to check the location. Please let me know if the coordinates remain the same.


Thank you for your reply. Now I will tell you what the situation is according to what I know. I don’t know how to use the two functions you told me, please forgive me.Now what I know is that when I’m using it in the editor if my camera’s perspective changes the position of the print changes but the position of the object doesn’t change and it’s only when I pack it and my camera moves that the water moves.Now I’m going to show you some screenshots of me in action

The packaged health state

It is worth mentioning that when I run it from the packed state, the location of each body of water is mostly around that location and I believe it has been converted by some plugins

Above is the simulated state of the editor

Next is the packaged state

Forgive me if it’s a little messy

Hi @11180 ,

As you identified in your original post, this is due to Unreal’s water system working incorrectly when the origin is rebased. The most straightforward solution is to disable origin rebasing by going to the CesiumGeoreference actor in the world outliner, and disabling the “Keep World Origin Near Camera” option.

If you require origin rebasing to be enabled for other reasons, you may need to automatically move the water body by the same amount that the origin is translated every time the origin changes. You can do this by overriding ApplyWorldOffset in a custom actor and using the origin translation given through the function to “fix” the water body’s position. We haven’t tried this with a water body however, so I’m not sure this second suggestion will work but it may be worth a try for you.

Let me know if these suggestions don’t work for you.

Nithin Pranesh

Thank you. I appreciate your advice, but I don’t fully understand how to do it. Could you show me the blueprint

Hello, I still have a question. When I prohibit the camera and camera from approaching the near camera, the position of the water body will not change. The position of the water body is still not correct

The coordinate transformation didn’t seem to work

Hi @11180,

Thanks for testing this out. I’m pretty certain at this point that it’s a bug with the water plugin, and I don’t know that there’s anything you can do on your end to resolve it. Like you found, the transform position of the water isn’t actually changing at all, but it visually moves and renders in an incorrect spot. I’ve also found that the water likes to follow you if you move the camera away from the scene.

I’m not sure if this is caused because of the georeferencing in the Cesium plugin, or some other issue. I’ve made an issue on our github repository to take note of it for the future - Water plugin custom water bodies render in an incorrect location with Cesium for Unreal · Issue #609 · CesiumGS/cesium-unreal · GitHub

For your project, you may want to consider using a Plane mesh with a water material applied, rather than the water plugin.