我用小游戏IDE引入three.js的json动画模型时,web-view组件安全域名设置问题--微信小程序开发。模拟器可以出来,真机提示死循环,请问代码中哪里错了吗?-----------------------------------------------------------------------------------------------------------------var loader = new THREE.JSONLoader();loader.load('http://image.nardiaoyu.com/video/2018/2/11/neex7hh.js', function (geometry) {var material = new THREE.MeshPhongMaterial({color: 0xffffff,specular: 0xffffff,shininess: 20,morphTargets: true,vertexColors: THREE.FaceColors,flatShading: true});var mesh = new THREE.Mesh(geometry, material);var s = 0.35;mesh.scale.set(s, s, s);mesh.position.y = 15;mesh.rotation.y = -1;mesh.castShadow = true;mesh.receiveShadow = true;
scene.add(mesh);console.log("mesh", mesh)
mixer = new THREE.AnimationMixer(mesh);mixer.clipAction(geometry.animations[0]).setDuration(1).play();console.log("mixer", mixer)
mixers.push(mixer);console.log("mixers", mixers)
for (var i = 0; i < mixers.length; i++) {console.log("mixers.length", i)}});
-----------------------------------------------------------------------------animate() {requestAnimationFrame(this.animate.bind(this), canvas);this.render()//console.log("aaaaa")//stats.update();}
render() {var delta = clock.getDelta();for (var i = 0; i < mixers.length; i++) {//console.log("mixers.length", mixers.length)
mixers[i].update(1000*delta);//console.log("t", t)*}
本文网址:http://www.91bianli.com/weixinxiaochengxu/56152.html