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