【发布时间】:2019-06-01 15:28:20
【问题描述】:
这是我加载 .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,所以我不知道如何实现此代码。
我想以可读的方式访问对象的顶点,这就是为什么我不希望它加载为BufferGeometry。
【问题讨论】:
标签: javascript three.js geometry buffer-geometry