Skip to content

Instantly share code, notes, and snippets.

@polyclick
Last active August 29, 2015 14:19
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 polyclick/3677a3f2132dcf674ed4 to your computer and use it in GitHub Desktop.
Save polyclick/3677a3f2132dcf674ed4 to your computer and use it in GitHub Desktop.
Draw a line in threejs
// creates a white (!!) line from 0,0,0 to 300,0,0
// make sure background is other color than white ;)
var geometry = new THREE.Geometry();
geometry.vertices.push(new THREE.Vector3(0, 0, 0));
geometry.vertices.push(new THREE.Vector3(300, 0, 0));
var line = new THREE.Line(
geometry,
new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 1 } )
);
this.scene.add(line);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment