I'm using three.js and have the scene and everything set up but when I try to load a 3d object (.gltf from here sketchfab 3d object). But the object seems to load fully and then doesn't show up for some reason. The file is being imported correctly.
import laptop from './laptop/scene.gltf'
var objloader = new GLTFLoader();
objloader.load(laptop, function (gltf) {
gltf.scene.scale.set(2, 2, 2);
gltf.scene.position.set(220, 10, 400)
scene.add(gltf.scene);
});
This error is showing up in the console which doesn't make sense because it should be placed correctly.
RangeError: attempting to construct out-of-bounds TypedArray on ArrayBuffer
I have fixed this problem by converting the gltf to glb. The gltf folder had textures folder inside as well as a binary file. Perhaps React was not taking those extra files into account. Because glb is the entire 3d object inside one file with no dependencies.