2017-04-18 149 views
0

我應該如何使一個aoMap爲一個正常的THREE.Geometry工作?有演示嗎?aoMap只適用於THREE.BufferGeometry嗎?

var uvs = geometry.attributes.uv.array; 

geometry.addAttribute('uv2', new THREE.BufferAttribute(uvs, 2)); 

上面的代碼是爲BufferGeometry。

回答

1

aoMap需要第二組UV。如果需要,可以通過複製第一組來創建第二組UV。

這是如何做到這一點的Geometry

geometry.faceVertexUvs[ 1 ] = geometry.faceVertexUvs[ 0 ]; 

這是如何做到這一點的BufferGeometry

var uvs = geometry.attributes.uv.array; 
geometry.addAttribute('uv2', new THREE.BufferAttribute(uvs, 2)); 

...或者更簡單地說:

geometry.attributes.uv2 = geometry.attributes.uv; 

three.js r.88

+0

謝謝,我會嘗試 – Lindy

+0

請記得點擊複選標記以「接受」答案。謝謝。 – WestLangley

+0

這應該絕對是被接受的答案。我希望很久以前能找到這個。 – Zoyt