threebox icon indicating copy to clipboard operation
threebox copied to clipboard

Unable to load mtl file

Open srinivasrk opened this issue 5 years ago • 0 comments

I'm trying to recreate the example https://github.com/peterqliu/threebox/blob/master/examples/logistics.html and I end up getting a warning on my console

threebox.js:4644 THREE.MeshPhongMaterial: .shading has been removed. Use the boolean .flatShading instead.
threebox.js:4675 THREE.MultiMaterial has been removed. Use an Array instead.

I do not see the truck object as well.

map.addLayer({
					id: 'custom_layer',
					type: 'custom',
					renderingMode: '3d',
					onAdd: function(map, mbxContext){
						window.tb = new Threebox(
							map, 
							mbxContext,
							{defaultLights: true}
						);
						// import truck from an external obj file, scaling up its size 10x
						var options = {
							obj: 'Truck.obj',
							mtl: 'Truck.mtl',
							scale: 10
						}
						tb.loadObj(options, function(model) {
							// console.log(model)
							var truck = model.setCoords(origin);
							console.log(truck)
							tb.add(truck);                        
						})


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

				})

This is the snippet I'm using to load the model

srinivasrk avatar Jul 09 '19 18:07 srinivasrk