Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

Rendering 241 Interactive 3D Stadiums in the Browser: Brotli GLB, Unified Seat-Map Geometry, and Mobile Sightlines

When you buy a stadium or concert ticket, most seating charts give you a flat 2D polygon and leave you guessing how steep the upper bowl is, whether a balcony overhang blocks the main screen, or how far a corner section

When you buy a stadium or concert ticket, most seating charts give you a flat 2D polygon and leave you guessing how steep the upper bowl is, whether a balcony overhang blocks the main screen, or how far a corner section actually feels from a concert stage.

While building Seat Viewpoint — a free, no-account 3D venue and concert seat-view explorer covering 241 stadiums and arenas across 12 languages — we hit four engineering problems that show up in almost any large-scale Three.js / WebGL web app. Here is what actually worked in production and what broke along the way.

1. One Data-Driven Model Format Instead of Per-Venue Code

Early prototypes tempted us to write custom React or Three.js branches for oddball venues (asymmetric baseball outfields, split-level club suites, or removable dome roofs). That collapses fast once you pass 20 venues.

Instead, every stadium, arena, and concert overlay compiles into a single versioned ArenaModel JSON + GLB geometry contract:

  • Shared renderer, data-only venue differences: Bowl tiers, aisle staircases, stage rigs, sightline obstructions, roof meshes, and section-to-row coordinate frames live in validated data rather than slug-specific runtime code.
  • Event overlays on top of base venues: A concert tour date binds a stage + floor-seating overlay to the base stadium model, so the same venue renders sports layouts and date-specific concert tours without duplicating the architectural shell.
  • Default roofless exterior + toggleable roof: Showing the real architectural facade with the roof hidden by default lets visitors immediately read bowl depth and orientation, then toggle the roof on from a fixed camera angle to check ceiling rigging and enclosed acoustics.

2. Delivering 3D Geometry Fast: Brotli-Compressed GLB + Edge Caching

Raw .glb files compress dramatically well with Brotli, especially when mesh vertex buffers are quantized and repetitive geometry is instanced.

Two subtle CDN details mattered more than our Three.js micro-optimizations:

  1. Content-addressed asset keys with immutable caching: Storing models under models/<sha256>/*.glb with Content-Encoding: br, Content-Type: model/gltf-binary, and Cache-Control: public, max-age=31536000, immutable keeps repeat visits instant and makes rollbacks trivial.
  2. Watch out for cf-cache-status: DYNAMIC: Some edge CDNs do not cache .glb or .hdr extensions by default unless you add an explicit cache rule for those paths. Verifying edge cache headers cut cold-load latency across the 241-venue catalog far more than tweaking draw calls alone.

3. Solving the 2D-to-3D Seat Map Problem on Narrow Mobile Screens

A 3D viewport is only half the UX. Users still locate their ticket by section number on a 2D map first — and 2D seat maps fail spectacularly on 375px phone screens:

  • Long section names collide in narrow bowls, while hiding labels makes small suites impossible to find. Our fix: render concise published section codes inside polygons, keep full names in search and accessible labels, and route crowded small sections to scrollable leader-line callout columns that collapse back inside the polygon as the user zooms in.
  • Two-step tier tapping on touchscreens: Trying to tap a tiny inactive upper-deck section on a phone often jumps straight into the wrong 3D view. Making an inactive tier a broad tap target first reveals that tier's section numbers on the 2D map; the second tap opens the exact 3D seat perspective.

4. Camera Framing and Side-by-Side Comparison

Computing a believable first-person eye position requires seating tread height, riser slope, row depth, and a realistic human eye offset above the concrete deck (plus checking that aisle portals and cross-aisle landings actually connect when looking backward or downward).

Because buyers rarely judge one section in isolation, we kept the exact venue, layout revision, section, row, and camera heading serialized in shareable URLs. That allows side-by-side seat comparison between two candidate tickets (for example, lower-bowl side angle vs. club-level front row) or across upcoming concert stage layouts without requiring an account.

Takeaways for WebGL App Builders

If you are shipping a multi-scene Three.js application on the web:

  1. Keep scene variation in validated data and retire per-scene code branches early.
  2. Verify your CDN actually caches .glb and environment maps at the edge (don't assume default rules cover 3D MIME types).
  3. Test mobile touch interactions and cold-load asset swaps during drag gestures, not just static desktop screenshots.

If you want to inspect the resulting WebGL viewer directly, you can explore any stadium or concert seating chart on Seat Viewpoint.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.