0
我想打電話給FaceNormalsHelper
從文件 three.js/src/extras/helpers/FaceNormalsHelper.js
但它似乎產生一個錯誤:呼喚「FaceNormalsHelper」的結果「類型錯誤:this.update不是一個函數」
TypeError: this.update is not a function
this.update();
錯誤發生在上述文件的第32行。 這是我做的調用(看最後一行):
var mesher = function mesher (aGeometry, position, color, name, woodTexture, debug) {
var texture,
material,
mesh;
if (woodTexture) {
texture = THREE.ImageUtils.loadTexture('crate.gif');
texture.anisotropy = makeRenderer.renderer.getMaxAnisotropy();
material = new THREE.MeshBasicMaterial({ map: texture });
} else {
material = new THREE.MeshBasicMaterial({ color: color, wireframe: true, side: THREE.DoubleSide });
}
mesh = new THREE.Mesh(aGeometry, material);
if (debug) {
var normals = THREE.FaceNormalsHelper(mesh);
console.log("normals: ", normals);
}
mesh.position.set = position;
mesh.name = name;
mesh.callback = function() { makeDOMelements.info.innerHTML = name; };
makeScene.scene.add(mesh);
};
Object.freeze(mesher);
return mesher;
}
mesher(myBox3, new THREE.Vector3(0, 0, 0), 0x3bf5de, "my test Box3", true, true);
我沒有看清楚在該助手應該獲得一個代碼「更新」方法來自。你有沒有證據表明有人真的在使用這門課? – Pointy 2014-08-27 19:32:53