Hello community,
I’m running a very simple local tile server to serve local terrain data and 3DTiles data in a docker container (nodejs server, using express).
For the terrain data there is no problem. In my webapp I set the terrainprovider url and it fetches the served terrain no problem (Cesium.CesiumTerrainProvider.fromUrl).
However, for 3DTiles data (tiletset.json + b3dm file) it does not work with this setup. The webapp correctly requests and reads the tileset.json, but it seems like it simply does not request the b3dm file afterwards. If I serve the exact same 3DTiles data within my app (using the nuxt3 serverside directly) it works as long as the served data is in the root folder of the project (or lower). As soon as I try to serve 3DTiles data from outside the project folder, it only requests the tileset.json and not the b3dm files anymore (Cesium.Cesium3DTileset.fromUrl). Is there anything I’m overseeing here? Why does Cesium not request the b3dm files if they are not the in project folder (I checked the network tab and it does not make a request at all after the tileset.json)?
Edit: I am using cesium 1.109
Best,
Jacques
It’s difficult to analyze the (technical) reason for this problem, based on the verbal description.
One wild guess:
When you load a tileset.json
, and the tileset is not visible in the viewer (for example, because the camera is looking away from the tileset), then it will not request any tile contents.
So when you have two cases,
- a case/setup where it does load the B3DMs
- a case/setup where it does not load the B3DMs
then one important question is: Are you using the same view configuration in both of them?
(Or are you sure that the tileset should be visible in the second case?)
If the tileset should be visible, then … there might be other reasons.
The problem may be related to the tileset itself (maybe it is using some strange content URIs, like content URIs that navigate through directory structures like .../.../data/tile.b3dm
and that cannot be resolved on the server or so). It may also be related to other aspects of the setup, but that would have to be analyzed further…
Hi Marco,
thanks for your response.
I am in all cases using the exact same file setup, which is the main reason for my confusion in this matter. The view configuration is also the same in all 3 cases, the scene starts a little bit zoomed out in the location the 3DTileset is supposed to appear (and in the one case when served from within the root folder it also appears there).
I was wondering if something might be up with the URI, but as said the filestructure remains the same in each case, the b3dm file being in the same folder as the tileset.json, which directly references the b3dm. And I’d also assume that, if the URI was being weird, there should still at least be a (failed) network request in the dev tools.
The other alternative that I thought of would be that somehow the location data gets lost (for whatever reason?) and that’s why it doesn’t request or render in the scene as expected. But again, I wouldn’t understand why that only happens when it is served from outside the rootfolder …
While technically in the current state, I could just throw the 3DTileset files into the root folder of the project and build it altogether as a workaround, for the future of my project when more and more files need to be served, this will not be a viable solution.
I was hoping to maybe have a look at how the Cesium3DTileset.fromUrl() function exactly works but couldn’t find it in the cesium code. Could you point me towards that maybe?