Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alishazh opened this issue Nov 7, 2024 · 0 comments
Open

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

alishazh opened this issue Nov 7, 2024 · 0 comments
Labels
🪲 bug Something isn't working

Comments

@alishazh
Copy link

alishazh commented Nov 7, 2024

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();
			}
		});
@alishazh alishazh added the 🪲 bug Something isn't working label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant