Do we have to create the tilesets.json manually by ourselves or is there any tool or templates can help to generate this file?
I am currently exploring on the Miami city sample data from CyberCity3D. I downloaded the Collada data and convert it to .glb, then convert it to .b3dm by 3d-tiles-tools. Now I have the .b3dm data, how can I use it?
Is there any recommended 3d building data sources which are already satisfied Cesium 3d requirements? Maybe some data source already has the tileset.json and b3dm files.
Does Cesium 3d tiles currently only support tilesets.json and .b3dm files data structure now? Or is there any other data format I can use in Cesium 3d tiles? Or I have always to find .dea or .obj data sources then convert them to .glb then .b3dm and manually write the tilesets.json file?
You will need to adjust the transform to have it centered at Miami. In Cesium you can do this with the following code, just replace longitude, latitude, and height to the desired values.
tileset._root.transform = Cesium.Transforms.headingPitchRollToFixedFrame(Cesium.Cartesian3.fromRadians(longitude, latitude, height), new Cesium.HeadingPitchRoll());
``
To answer your other question, the 3D Tiles “model” format will continue to be just b3dm with the glb embedded. Until more tools are available manually creating the tileset.json file is how it needs to be done.
Hi Sean,
I used the tileset.json file you recommended and changed the .b3dm url in that json file to my b3md file. But when I tried to do the "transform" function, I got an error said "Cannot set property 'transform' of undefined". Any idea?
BTW, why I cannot do something like this:
tileset.readyPromise.then(function(tileset) {
viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
});
This piece of code works well for data in 3d-tiles-samples data and the NYC data, but not for the Miami data.
Oh I see where this might cause problems. So instead, delete the transform property from the tileset.json, and set the tileset’s modelMatrix instead. Something like:
tileset.readyPromise.then(function(tileset) {
tileset.modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(Cesium.Cartesian3.fromRadians(longitude, latitude, height), new Cesium.HeadingPitchRoll());
viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
});
Actually, I am trying to create a 3d city using the 3d tiles just like the new york 3d city example given in cesium. Could you please tell me what to do in order to create the 3d tiles for the 3d city in cesium.