Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cdated
Last active August 9, 2016 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdated/b0c8395d4b6f6821e74fa3f64a60864b to your computer and use it in GitHub Desktop.
Save cdated/b0c8395d4b6f6821e74fa3f64a60864b to your computer and use it in GitHub Desktop.
Tube Loop
// start at, stop before 20, increase i by 1
for (var i=0;i<20; i += 1) {
var cover = new THREE.MeshNormalMaterial();
var cylinder = new THREE.CylinderGeometry(125, 125, 125, 30);
var tube = new THREE.Mesh(cylinder, cover);
// x values changes with the i value so they don't overlap
tube.position.set(-1000 + i*300, 0, -50);
scene.add(tube);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment