简体   繁体   中英

Three.js meshphongmaterial map not appearing

I'm trying to take a sphere and make clouds with it in threejs (around a blue, smaller sphere). The cloud sphere isn't showing up, even though the blue sphere is showing up. There are also no errors showing up, I think it is that the object is transparent on its entire body. Thanks for helping!

 const cloudTexture = new THREE.TextureLoader().load('./cloud_texture_2.jpg') const clouds = new THREE.Mesh(new THREE.SphereGeometry(3, 64, 64), new THREE.MeshPhongMaterial({color: 0xfffff, shininess: 0, map: cloudTexture, alphaMap: cloudTexture, transparent: true, depthWrite: false})) scene.add(clouds)

And here is the image: 黑白噪声纹理

Answer: depthTest should be selected, and CORS errors kept the image from being fetched. It is now fixed; I am using a local server on vscode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM