For the first question:
Placing the tileset that was generated from content files at a certain position on the globe certainly is a natural requirement. And there already are considerations to add this as some sort of convenience functionality in the 3d-tiles-tools
. But there currently is no built-in functionality for that yet.
If you are already using Cesium ion, then there is the option to use the “Adjust Tileset Location” function (in the upper right of the “My Assets” page, after selecting an asset). There, you can adjust the location of the asset accordingly:
If you want to adjust the location manually and in an offline-process, then for now, a reasonable workaround could be the following (I already mentioned that in another post, but will replicate the relevant part here for convenience):
1. Use the eastNorhUpToFixedFrame
function of CesiumJS to generate the required transform.
You can just open the CesiumJS sandcastle at Cesium Sandcastle , enter the following code (with your longitude/latitude/height values):
const transform = Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(43.970149521784, 56.260414816738106, 0)
);
console.log(Cesium.Matrix4.pack(transform, new Array(16), 0));
and press “Run”. This will print a matrix to the console, for example,
-0.6942835079850745,0.7197016121559956,0,0,-0.5984826914710163,-0.5773457436868751,0.5554190852466787,0,0.399736011074243,0.3856183109069252,0.831570586146325,0,2555492.883786797,2465239.113014277,5280601.728445846,1
2. Insert this as the transform
of the root node of your tileset.json
:
{
"asset": {
"version": "1.1"
},
"geometricError": 4096,
"root": {
"transform": [
-0.6942835079850745,0.7197016121559956,0,0,
-0.5984826914710163,-0.5773457436868751,0.5554190852466787,0,
0.399736011074243,0.3856183109069252,0.831570586146325,0,
2555492.883786797,2465239.113014277,5280601.728445846,1
],
...
}
This should place your tileset, as a whole, at the desired location.
Again, we’ll try to improve the tooling for functionalities like this, but for now, this somewhat “manual” process has to be used.
For the second question:
I’d recommend asking this as a new question in the Cesium ion section. The question is unrelated to 3D Tiles (or the topic of this thread in particular). But it might be relevant for other users as well, and can better be handled there.