The animation on our home page is neither a video nor a pre-rendered image. It is the real map of Le Locle, redrawn frame by frame in your browser: 2378 buildings, the streets, the railway, the relief of the valley, cars and a train. Here is how it is built, and how we took it from 11 to 180 frames per second.

The idea: show the place, not a stock photo
Le Locle is a watchmaking town, laid out on a grid for industry and listed with La Chaux-de-Fonds as a UNESCO World Heritage site for its town planning. This is where we work. Rather than an office photo or a generic image, we wanted to show this place with the same standards as our work: real data, a verifiable construction, nothing invented.
Where the data comes from
Everything starts with OpenStreetMap, the worldwide collaborative map. We exported an area of about 3 km east to west and 1.8 km north to south, centred on the valley, and kept three kinds of objects:
- buildings, with their exact footprint: 2378 in total;
- roads, ranked by importance (main roads, residential streets, paths): 773 segments;
- the railway, whose sections are joined end to end into a continuous line.
This data is embedded in the script itself. When you visit, no map server is called and no data goes anywhere else. The file weighs 1.2 MB, or 214 KB once compressed for transfer.
Identifying and rebuilding
A map is flat: to turn it into volumes, each object is interpreted from what the map says about it.
- Height. When OpenStreetMap knows it (height or number of floors, recorded for 719 buildings), it is used, at 3.1 m per floor. Otherwise it is estimated at two to four storeys, consistently for each building.
- Roof. Industrial and commercial buildings and large volumes get a flat roof. The others get a gable roof, aligned with their longest side. When the roof shape is described in the map, it takes precedence.
- Relief. A grid of elevations with a 50 m spacing covers the valley. Between its points, the elevation is interpolated, which sets each building and street on the terrain. The "Relief" button strengthens or flattens the valley.
Drawing in volume
The view is an oblique projection with a slight perspective: what is close appears a little larger. Buildings are sorted from farthest to nearest and painted in that order, like a painter laying in the background first. Façades facing away are not drawn. At night, windows light up irregularly, and the main roads carry a warm glow.
Life in the town
- Cars drive on the longer streets, in both directions, at different speeds.
- The train is a four-car set running back and forth on the line, headlight on at night.
- Street lamps stand every 26 m along the main roads, alternating sides.
- The camera movement is slow and damped, from left to right. The mouse shifts it slightly.
Live figures
Below the animation, three figures are measured on your own device: the number of objects drawn, the time it takes for the town to be ready, and the number of frames per second. They are not values written in advance.
What we fixed
The first version redrew the whole town on every frame: 2378 buildings with their façades and roofs, plus a glow effect on every car headlight. On a recent PC with a modern graphics card, this gave about 11 frames per second, with jerky movement.
Yet the scenery does not move. It is now computed only once, in two layers (the ground with its streets, then the buildings), and only the moving elements are redrawn: cars, train, lights. The cars stay between the two layers, so they are always hidden by the buildings. During a zoom, the scenery already computed is enlarged, then recomputed sharply once the zoom ends.
The result, measured on the same PC: 180 frames per second, the limit of its screen, instead of 11. On a simulated phone, the gain is about sevenfold.
What comes next
This animation is deliberately simple: one view, a slow movement, a few settings. The next step would be to wander freely through the town, which needs a different rendering engine, in 3D on the graphics card. We are thinking about it.
See the animation on the home page
Map data: © OpenStreetMap contributors, under the ODbL licence.