Created
March 29, 2012 21:20
-
-
Save jicksta/2243919 to your computer and use it in GitHub Desktop.
Create origin lines 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
function v(x, y, z) { | |
return new THREE.Vertex(new THREE.Vector3(x, y, z)); | |
} | |
var lineGeo = new THREE.Geometry(); | |
lineGeo.vertices.push( | |
v(-50, 0, 0), v(50, 0, 0), | |
v(0, -50, 0), v(0, 50, 0), | |
v(0, 0, -50), v(0, 0, 50) | |
); | |
var lineMat = new THREE.LineBasicMaterial({ | |
color: 0x000000, lineWidth: 1}); | |
var line = new THREE.Line(lineGeo, lineMat); | |
line.type = THREE.Lines; | |
scene.add(line); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment