Skip to content

Instantly share code, notes, and snippets.

@nklsrh
Created July 10, 2013 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nklsrh/5963175 to your computer and use it in GitHub Desktop.
Save nklsrh/5963175 to your computer and use it in GitHub Desktop.
// ---------------------------------
// Based on Aerotwist's cool tutorial - http://www.aerotwist.com/tutorials/getting-started-with-three-js/
// ---------------------------------
// set up the sphere vars
// lower 'segment' and 'ring' values will increase performance
var radius = 5,
segments = 6,
rings = 6;
// create the sphere's material
var sphereMaterial =
new THREE.MeshLambertMaterial(
{
color: 0xD43001
});
// Create a ball with sphere geometry
var ball = new THREE.Mesh(
new THREE.SphereGeometry(radius,
segments,
rings),
sphereMaterial);
// add the sphere to the scene
scene.add(ball);
@aterribili
Copy link

aterribili commented Jan 16, 2017

I fixed the line 23, it was missing the end ). Look at: https://gist.github.com/aterribili/71691521c65162b3c6757a2d844d4922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment