Home  »  CodeLibrariesProgrammingSnippetsTechnologyTools   »   Create Three.js Sphere Example Code

Create Three.js Sphere Example Code

Posted: January 2, 2023 | by Michael Bright

Using the SphereGeometry class to create a sphere.

const geometry = new THREE.SphereGeometry( 15, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.