【问题标题】:THREE.js - Multiple facesTHREE.js - 多个面孔
【发布时间】:2012-03-17 19:02:55
【问题描述】:

我正在尝试使用 WebGL 在 Three.js 中为立方体赋予多个面。我确定关键在于

var geometry = new THREE.CubeGeometry( 80, 80, 80, 4, 4, 4, materials, true,true,false,true,true,true);

但我不明白如何使用“边”变量。 这是我的演示:

http://enriquemorenotent.com/demos/cube/

【问题讨论】:

    标签: three.js


    【解决方案1】:

    比我想象的要容易!

    var materials = [
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '1.png' ) } ),
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '2.png' ) } ),
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '3.png' ) } ),
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '4.png' ) } ),
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '5.png' ) } ),
        new THREE.MeshLambertMaterial( { ambient: 0xffffff, map: THREE.ImageUtils.loadTexture( '6.png' ) } )
    ];
    
    var geometry = new THREE.CubeGeometry( 80, 80, 80, 3, 3, 3, materials);
    cube = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial());
    

    【讨论】:

      猜你喜欢
      • 2016-03-27
      • 1970-01-01
      • 2014-02-10
      • 1970-01-01
      • 2015-04-16
      • 1970-01-01
      • 2017-06-03
      • 1970-01-01
      • 2014-09-30
      相关资源
      最近更新 更多