Using SVG as scalable texture

本秂侑毒 提交于 2020-01-22 14:50:32

问题


I'm new to three.js and WebGL in general and I'm trying to make a simple earth globe in 3D with a SVG texture applied on it (so that I can zoom in without quality loss).

I tried to load a svg image instead of my png image. I worked, but the image was "rasterized" removing all advantages of using svg :/

Is is possible to do that ? If yes how ?

Thanks

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);
    });

来源:https://stackoverflow.com/questions/49860515/using-svg-as-scalable-texture

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!