0

Here goes my first question, I hope you can help me. I'm writing a peice op code to show an .obj file in mapbox using Threebox. The problem is that the .gltf file shows on the map but the .obj file doesn't. Can you help me?

 map.on('style.load', function () {
        map.addLayer({
            id: 'custom_layer',
            type: 'custom',
            renderingMode: '3d',
            onAdd: function (map, mbxContext) {

                // import model from
                var options = {
                    obj: "{% static 'obj/three.obj' %}",
                    mtl: "{% static 'obj/three.mtl' %}",
                    type: 'obj',
                    scale: 100,
                    units: 'meters',
                    rotation: {x: 0, y: 0, z: 0}, //default rotation
                    anchor: 'center'
                }

                tb.loadObj(options, function (model) {
                    let building_object = model.setCoords(origin);
                    tb.add(building_object);
                })

            },

        render: function (gl, matrix) {
            tb.update();
        }
    });

});

Thanks in advance

0 Answers0