Open hohaidang2000 opened 4 years ago
oh this line above too: let loader = new GLTFLoader();
hi, you can upgrade three to "0.123.0" first, then use GLTFLoader like this in load-obj.js
` import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
export function loadGlftObj(filePath) { const loader = new GLTFLoader(); return new Promise((resolve, reject) => { loader.load(filePath, function ( gltf ) { resolve(gltf.scene) }, undefined, function ( e ) { console.error( e ); } ); }); } `
here is my import import { BoxGeometry, MeshBasicMaterial, Mesh, BoxHelper,GLTFLoader} from 'three'; here is the part that i add in render 3d: let loader = new GLTFLoader();
it broke down when i try 3d view even when i don't load the model in Promise.resolve(mesh); it only works after i delete the above codes. So is there any alternative way to import 3d model?