加载.obj的线框材质 - Three.js

时间:2017-11-17 06:14:50

标签: three.js wireframe

如何在three.js中为加载的.obj显示或加载线框素材?

1 个答案:

答案 0 :(得分:1)

您需要设置object.children,试试这个。

    // MTL SETUP
    const mtlLoader = new MTLLoader(manager);
    mtlLoader.setBaseUrl( '../../../../assets/3D_models/brain/' );
    mtlLoader.setPath(  '../../../../assets/3D_models/brain/'  );

    mtlLoader.load(this.brain_mtl_path, (materials) => {
      console.log(materials);

      // materials.preload();

      // OBJ SETUP
      const objLoader: any = new THREE.OBJLoader(manager);
      objLoader.setMaterials( materials );
      objLoader.load(this.brain_obj_path, (object) => {

        console.log(object);

        object.children[0].material.wireframe = true;