Spawn 3DTileset with correct geolocation

When I add a blank tileset and set the Url within the editor, the tileset is automatically placed at it’s correct geolocation without needing to type in the geolocation but when I add a tileset at runtime using blueprints spawnActor node, I need to give it a Transform which causes the tileset to be placed incorrectly because I don’t know the transform.

This is how I spawn the tileset:

How can I spawn the tileset with the correct geolocation like adding a blank tileset in the unreal editor but with blueprints? Maybe there is a node I can call to “reset” the tileset to its correct location?

Thanks.

Hi @aaa1a,

When you add a blank tileset from the Cesium panel, it simply sets the transform to all zeros, just like you’ve done in the blueprint in your screenshot. Most (but not all) 3D Tiles tilesets have an explicit location on the globe, and this plus the CesiumGeoreference Actor are used to compute the correct location for the tileset in the Unreal world. The transform then acts as an offset from this, so usually an identity transform is what you want.

However, if your 3D Tiles tileset does not know its location on the globe (e.g. it’s a model of a building with a local origin, ready to be placed anywhere on the globe that you choose), then the default behavior won’t work so well. You’ll want to create a new CesiumGeoreference, set it to “True Origin” mode, and specify the tileset to use that new Georeference. At that point, the origin of the tileset will be located at the origin of the Unreal world, and the transform can be used to place it wherever you like in the Unreal world.

Kevin

Hi Kevin,

Thanks for the reply. My tileset.json does have a explicit location (the last 3 numbers are the ECEF xyz coordinates I think):
image

However, when I call my spawnActor blueprint, the tileset is not placed at that ECEF coordinate. It is placed at 0,0,0 unreal world (if I don’t move my dynamic pawn). e.g. If I move my dynamicpawn to a new location (in-game) and then call the blueprint again, the newly spawned tileset gets placed at the new 0,0,0 instead of the ECEF coordinate in the tileset.json. Calling the blueprint multiple times and moving in between creates multiple tilesets all at different locations.

But if I add a blank tileset and set Url from Cesium panel, the tileset gets placed at a similar ECEF to the numbers in the tileset.json. I checked the ECEF by adding a georeference component to the tileset.
image

I am not sure why it is not placing the tileset at the correct location when called from blueprints.

Thanks.

What version of Cesium for Unreal are you using? The reason I ask is because you mentioned a Georeference Component, which was replaced with a Globe Anchor Component quite awhile ago. That same release also fixed many georeference-related problems. The latest version is v1.8.1.

I updated to 1.8.1 from 1.6.2 yesterday but it is still placed at 0,0,0 in the unreal world when spawning from blueprints.

Oh I think I understand, it probably has to do with world origin rebasing. The tileset should be located at (0,0,0) in Unreal’s absolute world coordinates, not the normal relative ones. Try computing the transform like this:

The unlabeled middle node is a vector minus vector subtraction, so basically the transform’s location is (0 - worldorigin).

Kevin

1 Like

Here’s a complete example you can copy/paste:

1 Like

Hi Kevin,

Thank you very much! Your solution worked, the tileset is now placed at the correct position just like creating tilesets from the cesium panel.