1. A concise explanation of the problem you’re experiencing.
Hello everyone,
I’m using tilers from the enterprise package that Cesium offers. Tiling an asset (file) gives me a cesium 3dtiles dataset, as expected.
What I’de like to do is extracting bounding volume and center in WGS84 coordinates from the generated tileset.
When browsing 3dtiles specification I find that every node has a bouding volume (box in my case) matrix and a transform matrix. https://docs.opengeospatial.org/cs/18-053r2/18-053r2.html
My guess is that it should be possible with some calculations between those 2 matrices to obtain WGS84 coordinates about the center and region of the tileset.
The goal is to access location information about a tileset without loading the cesium viewer (wich occurs later in the app).
I think CesiumJS wrap the math somewhere, but I don’t know exactly where to look.
Has anyone tried to do this ?
Any advice or idea ?
Thank you for the help !
P.S. :here is the location of these matrices in tileset.json files :
tileset.json (6.29 KB)
omar
March 16, 2020, 5:30pm
2
You can see the logic for how to compute the world location from the bounding volume here:
* Create a bounding volume from the tile's bounding volume header.
*
* @param {Object} boundingVolumeHeader The tile's bounding volume header.
* @param {Matrix4} transform The transform to apply to the bounding volume.
* @param {TileBoundingVolume} [result] The object onto which to store the result.
*
* @returns {TileBoundingVolume} The modified result parameter or a new TileBoundingVolume instance if none was provided.
*
* @private
*/
Cesium3DTile.prototype.createBoundingVolume = function(boundingVolumeHeader, transform, result) {
if (!defined(boundingVolumeHeader)) {
throw new RuntimeError('boundingVolume must be defined');
}
if (defined(boundingVolumeHeader.box)) {
return createBox(boundingVolumeHeader.box, transform, result);
}
if (defined(boundingVolumeHeader.region)) {
return createRegion(boundingVolumeHeader.region, transform, this._initialTransform, result);
}
if (defined(boundingVolumeHeader.sphere)) {
Let me know if this helps.