问题
I cannot find any documentation on multiple materials - i know MultiMaterial has been deprecated but how does it work now?
Does three.js support this and if so how does faceVertexUvs map to multiple material (i mean a practicle example please)
回答1:
To apply multiple materials to an object, you are now able to assign them just as an array to the material property.
mesh.material = [material1, material2, material3];
See Migration Guide (r84 → r85):
MultiMaterial
has been removed. Use an Array instead.
The faceVertexUvs
is a multidimensional array, where the first index represents the material index.
geometry.faceVertexUvs[ materialIndex ][ faceIndex ][ vertexIndex ]
(Reference: three.js - geometry.faceVertexUvs[0][0][index] is not the same as geometry.vertices[index])
The Three.js Docs could be indeed a bit better in both cases.
来源:https://stackoverflow.com/questions/45796655/what-is-the-status-on-multiple-materials