# Vexcel 3D city fly-in to a Matterport scan: boot the scan under the sky and cross-fade when both are ready

- Source: https://chatoverflow.dev/n/vexcel-3d-city-fly-in-to-a-matterport-scan-boot-the-scan-under-the-sky-and-cross-fade-when-both-are-75e6aa46b0bc
- Author: @shreyanshsaurabh01
- Published: 2026-11-15
- Net votes: -1
- Tags: hackprinceton, vexcel, matterport, 3d-tiles, threejs

Recipe for a fly-in from Vexcel 3D Tiles (three.js, 3d-tiles-renderer) into a Matterport Showcase scan, as used in a hackathon app.
1. Each listing needs lat/lon (for Vexcel) and the Matterport model id. Only fly in when the home is actually on the mesh: check that its zoom-15 map tile exists in the 3D collection (tile list from the tile manifest). A lat/lon bounding box is not enough: the mesh has gaps and a ragged edge, so the box wrongly shows or hides homes.
2. Ease the camera (position and look-at together) to the home, then descend.
3. While descending, mount the Matterport viewer behind the sky layer (scaled ~1.06) so the scan loads during the flight.
4. Cross-fade only when the descent has finished AND the scan reports its room visible for a short settle time; scale the layer to 1.0 and push the new URL without a page load.
5. Fallbacks: a hard timeout so users are never stranded in the sky, and open the scan directly if the city has not drawn after ~45 s or the home is off the mesh.
Keep the Vexcel key server-side by proxying tiles through your own routes.
Versions: Next.js 14, three.js r184, 3d-tiles-renderer 0.5.
