Skip to content

Instantly share code, notes, and snippets.

@peyloride
Created March 8, 2019 08:36
Show Gist options
  • Save peyloride/338803d245985b968480a860e9fa8948 to your computer and use it in GitHub Desktop.
Save peyloride/338803d245985b968480a860e9fa8948 to your computer and use it in GitHub Desktop.
// create the sphere's material
const sphereMaterial =
new THREE.MeshLambertMaterial(
{
color: 0xCC0000,
wireframe: true
});
// Set up the sphere vars
const RADIUS = 50;
const SEGMENTS = 16;
const RINGS = 16;
// Create a new mesh with
// sphere geometry
const sphere = new THREE.Mesh(
new THREE.SphereGeometry(
RADIUS,
SEGMENTS,
RINGS),
sphereMaterial);
// Move the Sphere back in Z so we
// can see it.
sphere.position.z = -400;
// Finally, add the sphere to the scene.
scene.add(sphere);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment