Terrain tile coordinates system

I created terrain tiles with ctb and they work great with cesium.
Now the thing is i need to use those tile in another framework for three.js.
The thing i dont understand is how the tile system works.
It does not seem to be the same as wtms tiles like https://tile.openstreetmap.org/5/16/11.png
For this example which correspond to the “region” i built with ctb i dont get that tile.
It seems there is a zoom delta (because i see x=16 in zoom 4). but there is also a delta in y which i cant seem to understand.
Can someone help in understanding how to choose the correct the terrain tile (from ctb) when i have wtms x/y/zoom ?


After search a bit and looking at Cesium code it seems the difference comes from cesium terrrain using TMS and other web services like osm using XYZ as explained here The difference between XYZ and TMS tiles and how to convert between them · GitHub.
Now the conversion format they talk about does not seem to work. as i said there seem to be a zoom “decale”.
Wondering if someone knows anything about this

Useful to read docs right?

i just need to specify --profile mercator while generating with ctb-tile.



I am glad to hear that you successfully created terrain tiles with ctb in Cesium. For questions related to three.js, I recommend that you reach out to their developers.