Add example: render a 3D Tiles quantized-mesh terrain tile (#4493)#7952
Add example: render a 3D Tiles quantized-mesh terrain tile (#4493)#7952clement-igonet wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7952 +/- ##
==========================================
+ Coverage 93.25% 93.38% +0.13%
==========================================
Files 290 290
Lines 24650 24579 -71
Branches 6471 6471
==========================================
- Hits 22987 22954 -33
+ Misses 1663 1625 -38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fed46ad to
61758d2
Compare
Proof of concept for the phasing proposed on maplibre#4493 ("Add 3D Tiles as a source for the terrain layer"): decodes a real quantized-mesh binary tile (header, vertex data, triangle/edge indices - the format used by Cesium/3D Tiles terrain) with no library dependency, and renders it via a custom layer using the origin-relative rendering technique from maplibre#4871/maplibre#7946. Uses a single tile (zoom 9) of real Cesium World Terrain data covering the whole Mont Blanc massif, so the demo is checkable against reality rather than a synthetic fixture, while keeping the bundled data to the minimum needed. Pins five named summits (Mont Blanc, Aiguille du Midi, Mont Blanc du Tacul, Dôme du Goûter, Aiguille du Plan) with floating labels, each rendered/positioned in the same origin-relative coordinate space as the terrain mesh so they track the actual sampled elevation instead of a flat ground plane. Raises maxPitch to 85 to allow a more dramatic viewing angle. Deliberately out of scope for this phase: dynamic LOD tile selection, elevation queries, layer draping, and occlusion-aware tile throttling - those belong to the "first valuable feature" and "hardening" phases proposed on the issue.
61758d2 to
6c36526
Compare
There was a problem hiding this comment.
please de-vibe your code. that is very sloppy, for example when it comes to comments. Not great...
Also, make the example minimal, so remove the markers and such, only the terrain handling code and only the minimal amount of code nessary..
Is there a lib we can use to help and trim down this code?
Decode via @here/quantized-mesh-decoder (MIT) instead of a hand-rolled decoder, drop the summit markers and multi-tile scaffolding, keep only the terrain handling. 507 to 192 lines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
OK. |
CommanderStorm
left a comment
There was a problem hiding this comment.
Much better, but still needs a bit of simplifcation
Drop the header comment, hardcode the fixture tile URL and bounds, inline the single-use matrix multiply. 192 to 173 lines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I'm not sure, looking only at the image of this example, what this example is really trying to achieve. |
POC for #4493 ("Add 3D Tiles as a source for the terrain layer").
Decodes a real Cesium World Terrain quantized-mesh tile (Mont Blanc massif, no library dependency) and renders it via a custom WebGL layer, with 5 named summit pins for a real-world sanity check. No core changes, no Source/Terrain integration - that's phase 2, in #7953.
Launch Checklist
Assisted-By: Claude Sonnet 5 (claude-sonnet-5)