What is the status of several materials?

I cannot find documentation for several materials - I know that MultiMaterial is out of date, but how does it work now?

Does three.js support this, and if so, how do faceVertexUvs map to multiple materials (I mean a practical example)

+1
source share
1 answer

To apply multiple materials to an object, you can now assign them as an array for a material property.

mesh.material = [material1, material2, material3]; 

See the Migration Guide (r84 โ†’ r85) :

MultiMaterial deleted. Use an array instead.

faceVertexUvs is a multidimensional array where the first index is the index of the material.

 geometry.faceVertexUvs[ materialIndex ][ faceIndex ][ vertexIndex ] 

(Link: three.js - geometry.faceVertexUvs [0] [0] [index] is not the same as geometry.vertices [index] )

Three.js docs may be a little better in both cases.

+1
source

All Articles