Three.js (r71) - 数据初始化问题
Three.js (r71) - Data Initialization issue
我遇到一个错误:
TypeError: undefined is not an object (evaluating 'data.initialized')
有人知道如何解决吗?我正在使用 three.js (r71),它已经修复了 #5831 bug.
loader = new THREE.JSONLoader();
loader.load( 'models/SL-MD-avatar_erica68.json', addModel );
var helpset;
function addModel( geometry, materials ){
materials[0].skinning = true;
objeto= new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial(materials));
objeto.setCastShadow = true;
objeto.receiveShadow = true;
scene.add(objeto);
helpset = new THREE.SkeletonHelper(objeto);
helpset.visible = false;
scene.add(helpset);
// Instantiate the animation
var animation = new THREE.Animation(objeto, geometry.animation);
// Start playing the animation
animation.play();
}
直接查看您的 json 文件:geometry.animation
是否存在? geometry.animations
更有可能?在这种情况下,它可能是一个数组,因此正确的参数是 geometry.animations[0]
我遇到一个错误:
TypeError: undefined is not an object (evaluating 'data.initialized')
有人知道如何解决吗?我正在使用 three.js (r71),它已经修复了 #5831 bug.
loader = new THREE.JSONLoader();
loader.load( 'models/SL-MD-avatar_erica68.json', addModel );
var helpset;
function addModel( geometry, materials ){
materials[0].skinning = true;
objeto= new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial(materials));
objeto.setCastShadow = true;
objeto.receiveShadow = true;
scene.add(objeto);
helpset = new THREE.SkeletonHelper(objeto);
helpset.visible = false;
scene.add(helpset);
// Instantiate the animation
var animation = new THREE.Animation(objeto, geometry.animation);
// Start playing the animation
animation.play();
}
直接查看您的 json 文件:geometry.animation
是否存在? geometry.animations
更有可能?在这种情况下,它可能是一个数组,因此正确的参数是 geometry.animations[0]