What is the status on Multiple Materials?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 03:24:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!