THREE.js,引入3d模型时报错THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The “positio

let loader = new OBJLoader();
let scene = new THREE.Scene();
let camera = new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,0.1,200);
 camera.position.set(40, 40, -40);
 loader.load( '../assets/flower.obj', ( obj )=> {
     let object = obj;
     scene.add(object);
 });

报错:THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The “position” attribute is likely to have NaN values.
不管是引入.obj ,.fbx,或是其他的,都有同样的错误

解决方法:
将要引入的文件放在public文件夹下

你可能感兴趣的:(vue.js,前端,git)