[Worker 1] Serving static directory ..\_tilesets\Cube-glb on /static/Cube-glb
[Worker 1] Serving on port 8002
Based on this, I know which path I need to use in Sandcastle:
var viewer = new Cesium.Viewer('cesiumContainer');
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : 'http://localhost:8002/static/Cube-glb/tileset.json'
}));
viewer.zoomTo(tileset);
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider : new Cesium.CesiumTerrainProvider({
url : 'http://localhost:8002/static/3DTileset/NagaiOoeRoad'
})
});
Apologies—my example wasn’t specific to terrain. Please see this documentation, under “Terrain from .terraindb database file.” Here is the example you need:
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url : 'http://localhost:8002/NagaiOoeRoad',
});
viewer.camera.flyTo({
destination: Cesium.Rectangle.fromDegrees(137.3286502, 36.342873, 137.3300283, 36.343922),
endTransform: Cesium.Matrix4.IDENTITY,
duration: 0.0
});
This assumes your NagaiOoeRoad.terraindb file is in C:/Cesium/_tilesets/Test and that you started the asset server with the path to the Test directory:
It’s not possible to fly to terrain in CesiumJS due to limitations of the quantized-mesh format. You will need to fly the camera to a position on the globe manually. Here is the documentation on that: Camera - Cesium Documentation
For terrain, you can use gdalinfo to grab the WGS84 extent from the source data and then use that to construct a rectangle using fromDegrees: Rectangle - Cesium Documentation
The flyTo example script I pasted above shows how to do this and should work for your data.