我不明白如何正常計算threejs。如何在threejs中獲得法線的正確值?
這裏是我的問題:
我創建了一個簡單的平面
var plane = new THREE.PlaneGeometry(10, 100, 10, 10);
var material = new THREE.MeshBasicMaterial();
material.setValues({side: THREE.DoubleSide, color: 0xaabbcc});
var mesh = new THREE.Mesh(plane, material);
mesh.rotateY(Math.PI/2);
scene.add(mesh);
當我讀到正常該平面的,我得到(0,0,1)。 但是該平面與z軸平行,因此這個值是錯誤的。
我嘗試添加
mesh.geometry.computeFaceNormals();
mesh.geometry.computeVertexNormals();
,但我仍然得到同樣的結果。
我錯過了什麼嗎?
如何從threejs獲得法線的正確值?
謝謝。
幾何法線在旋轉後不會重新計算? – CoccotCoder