vue-three 几何体 多面贴图

2021-12-03  本文已影响0人  name_howe
// 机柜
    chartlet(x, y, z){
      let map = new THREE.TextureLoader().load(require('@/assets/three/zhengm.png'));
      let map2 = new THREE.TextureLoader().load(require('@/assets/three/cem.png'));
      let map3 = new THREE.TextureLoader().load(require('@/assets/three/fanm.png'));
      let group = new THREE.Mesh();
      let color = 0x0c0c0c // 0x3C3B42
      let mats = [];
      mats.push(new THREE.MeshPhongMaterial({ map: map2 }));
      mats.push(new THREE.MeshPhongMaterial({ map: map2 }));
      mats.push(new THREE.MeshPhongMaterial({ color }));
      mats.push(new THREE.MeshPhongMaterial({ color }));
      mats.push(new THREE.MeshPhongMaterial({ map }));
      mats.push(new THREE.MeshPhongMaterial({ map: map3 }));

      let cubeGeom = new THREE.BoxBufferGeometry(700, 1200, 360);
      let cube = new THREE.Mesh(cubeGeom, mats);
      cube.position.set(x, y, z)

      group.add(cube);
      this.scene.add(group)
    }
上一篇 下一篇

猜你喜欢

热点阅读