使用SVG作为可伸缩纹理

时间:2018-04-16 15:01:09

标签: svg three.js

我对three.js和WebGL一般都很陌生,我试图在3D上创建一个简单的地球球体,并在其上应用SVG纹理(这样我可以放大而不会丢失质量)

我尝试加载svg图片而不是我的png图片。我工作过,但是图像是"光栅化的"消除使用svg:/

的所有优点

有可能吗?如果是的话怎么样?

由于

this.loader = new THREE.TextureLoader();
    this.loader.load("someimage.svg", texture => {
      //create the sphere
      const sphere = new THREE.SphereGeometry(RADIUS, SEGMENTS, RINGS);

      //map the texture to the material. Read more about materials in three.js docs
      const material = new THREE.MeshBasicMaterial({
        map: texture,
        overdraw: 0.5
      });

      //create a new mesh with sphere geometry.
      const mesh = new THREE.Mesh(sphere, material);

      //add mesh to globe group
      this.globe.add(mesh);
    });

0 个答案:

没有答案
相关问题