Skip to content

Using loadObj to load gltf, unable to add request parameters #441

@alishazh

Description

@alishazh

If my gltf resource requires a token to access, only the first gltf can request it during loading, and the image and bin requests inside are not compatible

My request is to include the token parameter in the image and bin requests

Here is my code

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

				window.tb = new Threebox(
					map,
					mbxContext,
					{ defaultLights: true }
				);

				var options = {
					obj: '/gltf-180/gltf/model.gltf?token=d3d373d11b2642208d59808d6783810e',
					type: 'gltf',
					scale: 1,
					units: 'meters',
					rotation: { x: 90, y: 0, z: 0 } //default rotation
				}

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🪲 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions