three.js将css添加到加载的纹理中

时间:2018-02-12 15:04:53

标签: javascript css svg three.js

使用three.js我正在将图像img.svg加载到网格/行星/球体上:

function createPlanet(){
  var texture = THREE.ImageUtils.loadTexture("img.svg");
    texture.repeat.set( 4, 2 );
    texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
    moonMat =  new THREE.MeshLambertMaterial ({
        color: 0x4c00b4,
        wireframe: false,
        shading:THREE.FlatShading,
        map:texture
    });

    var moonGeometry = new THREE.IcosahedronGeometry(530, 1 );
    moon = new THREE.Mesh(moonGeometry, moonMat);

    scene.add( moon );
}

如何添加CSS以仅应用映射到网格上的图像?

0 个答案:

没有答案