我一般对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);
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1212 次 |
最近记录: |