geodan / mapbox-3dtiles Goto Github PK
View Code? Open in Web Editor NEW3D Tiles implementation using Mapbox GL JS custom layers
License: BSD 3-Clause "New" or "Revised" License
3D Tiles implementation using Mapbox GL JS custom layers
License: BSD 3-Clause "New" or "Revised" License
Does cesium tilt photography model support
Add support for composite tiles, according to https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#introduction
I am using Metashape for modeling, but the exported 3D tiles cannot be loaded directly. May I know how to handle this? Thank you very much
Hi Tom,
Would this implementation work with a textured 3d model that has been presented as a 3D tile service?
Currently, the Geometricerror is ignored and tiles are loaded and unloaded according to the camera's frustum and the screenspace occupied by the tile's bounding volume. According to the specification, Geometricerror should be used to determine if a tile should be loaded/rendered. https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#geometric-error
Hello,
Thank you for making this open source!
I'm relatively new to MapBox. Could you please clarify what is the difference between this implementation, and the example at https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/ which uses a fill-extrusion
layer? What are the tradeoffs for each approach? When would you prefer one over the other?
Add boundingVolume.region support, see https://github.com/CesiumGS/3d-tiles/blob/master/specification/README.md#region
Pro's: smaller and more simple tileset.json
Please add a license so that others can build upon it.
Hi, Man
3dfiles cannot be loaded after setting the terrain。
Mapbox version 2.3.1
add support for uri of the glTF in i3dm
Currently only a embedded glTF is supported.
Specs: https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel#gltf
when header.gltfFormat == 0: glTF field contains a uri of the glTF
when header.gltfFormat == 1: glTF field contains bytes of the glTF
Add support for Composite tile format (cmpt), specs: https://docs.opengeospatial.org/cs/18-053r2/18-053r2.html#249
When trying to read an i3dm without NORMAL_UP and NORMAL_RIGHT vectors, there is an error:
'Cannot read property 'byteOffset' of undefined'
NORMAL_UP and NORMAL_RIGHT should be optional, as defined in https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel#instance-semantics
Currently, only Additive refinement is supported. According to the specification, Replacement refinement should also be supported. https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#refinement
I've created i3dm's containing glTF animations, but the animation is not playing :-(
Demo:
Add support for instanced 3D Tiles (i3dm).
Specs: https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel
Working sample in Cesium:
see https://bertt.github.io/cesium_3dtiles_samples/samples/instanced/
Contains 1 tile (tree.i3dm) with tree.glb and two instances defined. Right clicking displays batch information in console (Height: Height: 101 or 102)
Not working sample in MapBox:
see https://bertt.github.io/mapbox_3dtiles_samples/samples/instanced/
Content tree.i3dm:
i3dm file: tree.i3dm
i3dm header version: 1
i3dm GltfFormat: 1
i3dm header magic: i3dm
i3dm featuretable json: {"INSTANCES_LENGTH":2,"POSITION":{"byteOffset":0},"EAST_NORTH_UP":true}
i3dm instances length: 2
i3dm batch table json: {"Height":[100,101]}
positions: <-8407347, 4743739.5, 38.29>,<-8406181, 4744924, 38.29>
normal ups: : -
normal rights: : -
Scale non-uniform: : -
Scales: -
Batch ids: : -
Currently gltf loader is statically included, would be nice when it is a dependency. Available from:
https://github.com/johh/three-gltf-loader
Currently threejs/gltf loader is throwing shader errors. Updgrade should fix that.
I'm using latest version of develop branch, testing external tileset.json function. I encounter the following error when using external.json (which references tileset.json):
Mapbox3DTiles.js:53981 ReferenceError: TileSet is not defined
at ThreeDeeTile.load (Mapbox3DTiles.js:53964)
at ThreeDeeTile.checkLoad (Mapbox3DTiles.js:54186)
at ThreeDeeTile.checkLoad (Mapbox3DTiles.js:54192)
at Mapbox3DTilesLayer.loadVisibleTiles (Mapbox3DTiles.js:59708)
at Mapbox3DTiles.js:59799
Working site (references tileset.json):
https://bertt.github.io/mapbox_3dtiles_samples/samples/external/index_working.html#15.62/39.160792/-75.52649/0/45
Not working site (references external.json which references tileset.json):
https://bertt.github.io/mapbox_3dtiles_samples/samples/external/index_not_working.html#15.62/39.160792/-75.52649/0/45
The sample was working before upgrading to the latest commit in develop branch (old version was using mapbox-gl 1.9)
According to the specification, there are multiple ways to support point colors. None of those are currently supported. https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md#point-colors
After you resize the window or map, shadows are no longer correctly projected
For high precision instance positions in i3dm there should be support for RTC_CENTER in the featuretable.
Sample featuretable: {"INSTANCES_LENGTH":25,"RTC_CENTER":[1215013.8340490046,-4736316.75897742,4081608.4380407534],"EAST_NORTH_UP":true,"POSITION":{"byteOffset":0}}
Should be similar to the RTC_CENTER functionality in pnts tiles.
All Mapbox3DTiles layers are broken after removing a Mapbox3DTiles layer from the map, this has probably something to do with: https://github.com/Geodan/mapbox-3dtiles/blob/master/Mapbox3DTiles.mjs#L691
Uncaught TypeError: this.cameraSync is null
loadVisibleTiles Mapbox3DTiles.mjs:72
updateCallback Mapbox3DTiles.mjs:117
updateCamera CameraSync.mjs:120
CameraSync CameraSync.mjs:38
fire mapbox-gl.js:31
_fireEvent mapbox-gl.js:35
_fireEvents mapbox-gl.js:35
_updateMapTransform mapbox-gl.js:35
_applyChanges mapbox-gl.js:35
_requestFrame mapbox-gl.js:35
run mapbox-gl.js:35
_render mapbox-gl.js:35
_frame mapbox-gl.js:35
frame mapbox-gl.js:31
triggerRepaint mapbox-gl.js:35
_render mapbox-gl.js:35
_frame mapbox-gl.js:35
frame mapbox-gl.js:31
triggerRepaint mapbox-gl.js:35
_update mapbox-gl.js:35
_updateMapTransform mapbox-gl.js:35
_applyChanges mapbox-gl.js:35
_requestFrame mapbox-gl.js:35
run mapbox-gl.js:35
_render mapbox-gl.js:35
_frame mapbox-gl.js:35
frame mapbox-gl.js:31
Hi, very nice demo, thanks for sharing.
We are also developing a framework-independent 3d tile loader (part of our loaders.gl effort), you can see results developing at:
A few remarks:
Also:
LICENSE
file to your repo? As it stands, it is not clear whether we can use/copy/fork your codeloaders.gl/3d-tiles
loader and include as a demo on loaders.gl website (with attribution to yourselves of course!)Currently, only the Box bounding volume is supported. According to the specification, the Region and Sphere bounding volumes should also be supported. https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#bounding-volumes
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://repo.geodan.io/repository/npm/mapbox-gl failed, reason: socket hang up
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\wbz\AppData\Roaming\npm-cache_logs\2020-06-27T14_17_15_655Z-debug.log
Currently, only the root-tile transform of a tileset is supported. According to the specification, every tile can have its own transform as well. https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#tile-transforms
Add debugging functions, something like in Cesium: debugShowBoundingVolume, debugColorizeTiles, debugShowGeometricError, debugShowRenderingStatistics
Currently shadows are cast on the map layers, not on the objects rendered by mapbox-3dtiles
Add support for Instanced 3D Model tiles, according to https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#introduction
Shadows have jagged borders, improve shadow map resolution or lighting
When using glTF's with Draco compression there is an error:
THREE.GLTFLoader: No DRACOLoader instance provided.
at new GLTFDracoMeshCompressionExtension (GLTFLoader.js:556)
at GLTFLoader.parse (GLTFLoader.js:184)
at ThreeDeeTile.load (Mapbox3DTiles.js:295)
Sample:
I did an experiment with external tilesets see https://bertt.github.io/mapbox_3dtiles_samples/external.html
In this sample parent file external.json (https://bertt.github.io/mapbox_3dtiles_samples/external.json) is loaded, after that I can see child
tileset.json (https://bertt.github.io/mapbox_3dtiles_samples/tileset.json) is also loaded. But nothing is drawn on the map :-(
The same trick works in Cesium viewer.
When directly using child tileset https://bertt.github.io/mapbox_3dtiles_samples/tileset.json it works as expected (see https://bertt.github.io/mapbox_3dtiles_samples/index.html)
Hey,
really cool work!
i have some basic questions:
Hi, I'm new to 3d tiles and trying to use this lib to display my cesium asset tiles, and found during the checkLoad, there is no boundingvolume intersets with the camera frustum. Below are my understanding toward this issue and how this lib works, and I wish you can help me to clarify some of the doubts and point a direction. Thank you so much.
To my understanding, this is how 3d tile works: The vertex info in b3dm/pnts are merely forming meshes in a non-georeferenced Cartesian coordinate system. It is the boundingvolume that defines its geo location and bounding. And the bounding volume can be in any crs or even non georeferenced(in 3d scene Cartesian coordinate system). The transform is applied to project children's crs to the parent's crs, or from root crs to base map crs(in this case, web mercator EPSG:3857 for mapbox).
So I assume the problem with my case lies in the crs. The cesium ion assets are not in EPSG3857(There is no crs info in the tileset.json, I assume it is in EPSG: 4979 since it is recommended in the 3d tile standard), and the transform provided is not from 4979 to 3857.
So there can be two approaches:
I've tried gdal and epsg.io to transform 4979 to 3857, but failed. And I don't really have a clue about how to form the transform matrix needed from 4979 to 3857.
Could you please help to clarify the doubt and shed some light upon this issue?
Thank you.
After npm install, the following error occurs:
fetchMetadata: sill fetchPackageMetaData error for mapbox-gl@^1.10.0 request to https://repo.geodan.io/repository/npm/mapbox-gl failed, reason: socket hang up
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.