Search Three3D

All articles

3D Maps

Streaming a city into Three.js

How 3D Tiles Renderer loads city-scale geometry, one level of detail at a time.

A 3D photogrammetry view of Tokyo with Tokyo Tower near the center

A city can contain far more geometry than a browser should load at once. A 3D Tiles dataset organizes that geometry into a hierarchy. As the camera moves, the renderer requests the tiles that cover the current view at the appropriate level of detail.

Start with a sample tileset

Install 3d-tiles-renderer and point its Three.js adapter at a tileset.json file. Register your camera, set the renderer resolution, and add the tile group to your scene.

import { TilesRenderer } from '3d-tiles-renderer/three';

const tiles = new TilesRenderer('/samples/tileset.json');
tiles.setCamera(camera);
tiles.setResolutionFromRenderer(camera, renderer);
scene.add(tiles.group);

// Call these in your render loop after updating the camera.
camera.updateMatrixWorld();
tiles.update();
renderer.render(scene, camera);

Use the path to a tileset you host locally. Place the camera near the tileset bounds, or recenter the group for an isolated demo. Georeferenced datasets can sit far from the scene origin.

A blue dragon loaded from a sample 3D tileset in a Three.js viewer
A small sample helps verify that tile loading works before you try a city dataset.
A small faceted blue icosahedron from the coarse root tile at the farther camera position

Far view · Root tile · 20 triangles

A larger smooth blue shape from the detailed child tile at the nearer camera position

Near view · Child tile · 500 triangles

A local two-level tileset with REPLACE refinement. At each distance, the image was captured after the renderer reported the expected tile as visible. Moving closer made the coarse tile’s projected error large enough for the child to replace it. Three3D test tileset · NASA-AMMOS 3D Tiles Renderer.

Renderer source and setup · Original article (Chinese)