我不確定這是否是錯誤,但是一旦您在THREE.BoxGeometry
中調用geometry.computeVertexNormals()
,並且計算了頂點法線,我認爲結果向量是錯誤的。Three.js上的VertexNormals計算
以this爲例:
geometry = new THREE.BoxGeometry(50, 50, 50);
geometry.computeVertexNormals();
material = new THREE.MeshNormalMaterial();
如你看到的一切看起來正常完成,但是如果你軸線你看到載體在different方向指向旋轉X。
mesh.rotation.x = 90 * Math.PI/180;
我們不應該期望矢量在幾何合併之前從3個現有矢量的中心精確指向嗎?像這樣:
如果沒有,爲什麼會發生這種情況的任何解釋?
在此先感謝。
調用'mergeVertices'或者不對我造成任何影響 –
你是對的。 three.js在創建'THREE.BoxGeometry'時顯然已經刪除了重複的頂點。我習慣用WebGL創建一個立方體,最終得到24個頂點。發現得好。 – andrevenancio