Cesium world中,远离origin位置的实体姿态会有倾斜?

CesiumGeoreference设置Origin原点。在原点附近的实体看起来是正常的,但离原点较远的位置处实体看起来就会倾斜,有什么办法可以解决这样的问题?


Hi @wszty,

CesiumGeoreference sets the Origin origin. The entity near the origin looks normal, but the entity farther away from the origin looks tilted. Is there any way to solve this problem?

This is actually expected behavior in the plugin, because your object has to account for the fact that the Earth is round. When you move the entity in a straight line, it eventually will not align with the Earth’s curvature, and it will seem like the Earth is tilting.

Cesium will handle this automatically for you if you attach a CesiumGlobeAnchor component to the object that is travelling. Make sure that the Adjust Orientation For Globe While Moving setting is true, so that the object automatically accounts for the globe curvature. You can also attach a CesiumOriginShift component to the object; this will reposition the georeference origin as the object moves.

Let me know if those solutions help!


按照您说的办法,加上了CesiumGlobeAnchor,但是问题并没有解决,希望得到您的再次帮助

我觉得你这个问题解决方法如下:BP_Entity还是需要CesiumGlobeAnchor的,但还有一些工作要做。(1)在更新BP_Entity的位置循环中需要判断当前CesiumGeoreference与要更新的经纬度位置的差异,差异太大比如经度或维度差超过1度,就要重新设置CesiumGeoreference的Origin经纬度。(2)循环中要总是用当前的CesiumGeoreference为参考转成UE坐标系后去更新BP_Entity的位置。

仿照dynamicpawn,加了相机和模型,然后让它在场景中一直移动,看着没问题,镜头一直水平平行,但在pawn移动过程中把Player0切换到其它地方,再切回来,会发现镜头不在水平平行。镜头不切的情况下,让这个pawn绕地球一圈都没出问题。