这是我的代码来加载一个。fbx对象,将对象加载为
BufferGeometry
默认情况下:
var loader = new THREE.FBXLoader();
async function loadFiles(scene,props) {
const {files, path, childName, fn} = props;
if (index > files.length - 1) return;
loader.load(path+files[index], object => {
// apply functions / transformations to obj
let sceneObj = fn.call(null,object,props);
if (sceneObj) { scene.add(sceneObj) }
// add obj to scene and push to array
scene.add(object);
objects.push(object);
// if there is another object to load, load it
index++;
loadFiles(scene,props);
});
}
我想用
var geometry = new THREE.Geometry().fromBufferGeometry( bufferGeometry );
来解决这个问题,但我似乎没有建立一个
mesh
在我的加载器函数中,所以我不知道如何实现这段代码。
我想以可读的方式访问对象的顶点,这就是为什么我不想将其加载为
缓冲几何
.