three.js updating geometry face materialindex

前端 未结 1 869
谎友^
谎友^ 2020-12-11 03:42

Is there a way to change the materialIndex on a face of an existing Mesh? This isn\'t discussed in the How to Update Things documentation, so I am not sure if it\'s possible

相关标签:
1条回答
  • 2020-12-11 04:35

    This behavior has changed.

    If you are using THREE.Geometry, you can use the following pattern to change a face material index:

    mesh.geometry.faces[ 0 ].materialIndex = 1;
    

    If the geometry has been previously-rendered, you must also set

    mesh.geometry.groupsNeedUpdate = true;
    

    three.js r.88

    0 讨论(0)
提交回复
热议问题