Display wireframe and solid color

后端 未结 4 667
清歌不尽
清歌不尽 2020-11-27 17:56

Is it possible to display the wireframe of the object and also the solid color of its faces on the same object? I found a way using a clone of the object and assign differen

4条回答
  •  余生分开走
    2020-11-27 18:35

    To avoid cloning my object I used a pattern like that :

    var mat_wireframe = new THREE.MeshBasicMaterial({color: 0x000000, wireframe: true});
    var mat_lambert = new THREE.MeshLambertMaterial({color: 0xffffff, shading: THREE.FlatShading});
    var meshmaterials = [ mat_wireframe, mat_lambert ];
    

    and then applied it to my mesh like that :

    var myMesh = THREE.SceneUtils.createMultiMaterialObject( mesh_geometry, meshmaterials );
    scene.add( myMesh ) ; 
    

    I hope it could help...

提交回复
热议问题