peterqliu / threebox

A three.js plugin for Mapbox GL JS, with support for basic animation and advanced 3D rendering.
MIT License
526 stars 320 forks source link

Unable to add GLTF models to mapbox gl in v0.51.0 onwards #53

Closed jackmbox closed 5 years ago

jackmbox commented 5 years ago

var loader = new THREE.GLTFLoader();
loader.load(model3DSrc, (function (gltf) {

            gltf.scene.rotation.x = modelRotate[0];

            threebox.addAtCoordinate(gltf.scene, modelOrigin);

}

the above works for and the model can be seen added to the mapbox map canvas:

but after updating the mapbox version to v0.51.0 onwards to v0.53.0, the model is added but it cannot be seen on the map anymore.

peterqliu commented 5 years ago

@jackmbox can you make a test case?

AmeliaWang93 commented 5 years ago

I tried to load models with different versions of mapbox, and I find that the file in dist/threebox.js is the version only for mapbox v0.50. It's necessary to build the file with source code by yourself if you use mapbox v0.50+. I think it will be the best if the author can update the files for more users.

jackmbox commented 5 years ago

I tried to load models with different versions of mapbox, and I find that the file in dist/threebox.js is the version only for mapbox v0.50. It's necessary to build the file with source code by yourself if you use mapbox v0.50+. I think it will be the best if the author can update the files for more users.

I've tried rebuilding the file with the source code and it works with v0.53.1 now. Thanks for the awesome work.

bennlich commented 5 years ago

@jackmbox @peterqliu maybe would be good to commit the new build to master/dist? I just ran into this problem too.