vendredi 29 janvier 2021

Three.js - How do I change the edge colors of my SphereGeometry object?

This is the basic example from the Threejs documentation

function initSphere(){
       const geometry = new THREE.SphereGeometry( 150, 14, 14 );
       const material = new THREE.MeshBasicMaterial( {color: 0xFF0000, vertexColors: 0xFFFFFF} );
       const sphere = new THREE.Mesh( geometry, material );
       scene.add( sphere );
}

It creates a red sphere which is what I wanted, but I can't really see the sphere and it's edges because it just looks like a red circle. I was thinking that changing the edges to a white color would help make the effect I want, but I can't seem to know how to ask this question to solve it.

Can anyone help?




Aucun commentaire:

Enregistrer un commentaire