When i add the truck.glb as a custom layer with threebox to a mapbox map, every thingworks fine. All the models from the examples are fine. Every model edited by me with three.js editor or nunustudio.org is rendered as a giant grey ball far away in space hundreds of km's above the ground.
With the same code:
// model
var options = {
type: 'gltf',
obj: 'models/truck.glb',
scale: 100,
units: 'meters',
anchor: "bottom",
rotation: { x: 90, y: 90, z: 0 }, //rotation to postiion the truck and heading properly
}
tb.loadObj(options, function (model) {
truck = model.setCoords(origin_truck);
truck.set({ rotation: { x: 0, y: 0, z: 7200 }, duration: 200000 })
tb.add(truck);
})
The models from the threebox examples is displayed as expected but EVERY other model exported as .glb or .gltf looks like a cliffhanger for a sequel from very bad science fiction movie:
What am i doing wrong when exporting from three editor?
Thx for a hint
Please find a model under
probolt.ch/test.glb
Renders perfectly in the editor but one big black marble in the threebox. Thx for your support.
Your problem has nothing to do with Threebox or Three... I downloaded it and your model is just a sphere... Opened with 3D Viewer:
Opened with threejs.org/editor
The problem is that you have created a huge sphere around your model apparently to create the sky, which is unnecessary and not the way if you want to create an environment to cast and reflex lights.
If you just hide or remove
mesh_0
your model will be shown in any tool.And also in Threebox
This is the relevant code (I added a tooltip, real sunlight & shadow):