Last active
August 29, 2015 14:19
-
-
Save polyclick/3677a3f2132dcf674ed4 to your computer and use it in GitHub Desktop.
Draw a line in threejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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