General questions on asset retrieval in Cesium

Hiya,

First off, let me say that Cesium is awesome and I was surprised to see some of the stuff you can do with JS and WebGL from the Sandcastle demos. I’m not really into web dev, but the demos have definitely got me thinking of interesting ways I could use Cesium.

I had a couple of general questions on how Cesium works under the hood. Specifically, I want to know a bit more on how Cesium goes from the camera that’s being panned/rotated/zoomed around in the main viewport to figuring out what assets need to be shown on the globe.

Say you had a database of POIs with lon/lat coordinates. Given an arbitrary camera position/orientation (and all of the camera’s parameters that make up the frustum,etc) how does Cesium figure out which of these POIs should be shown on the map? What about tiles instead of just POIs (with tiles you also have LOD to worry about too)… what camera parameters are used to detemine the LOD (zoom level for tiles)?

Regards,

Preet

Hi Preet,

Thanks for the kind words. Actually, most of the Cesium devs were not web developers until we saw WebGL and became interested.

For terrain and imagery, tile selection is based on hierarchical level of detail using a pixel error tolerance to drive refinement, so it depends on the camera’s position, direction, and field-of-view. Loosely speaking, tiles outside of view because they are to the side or behind the viewer or across the horizon are not loaded, and tiles in view are loaded at a resolution based on their distance to the camera (and the field of view plays a role). My thesis is actually not a bad place to start exploring this in more detail. Kevin (who implemented this in Cesium) and I also wrote a related book.

As for doing this with POIs, we have not coded anything yet, but many of the same ideas apply. In many ways, POIs are easier since they are discrete points.

Regards,

Patrick