Skip to content

Instantly share code, notes, and snippets.

@jicksta
Created March 29, 2012 21:20
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 jicksta/2243919 to your computer and use it in GitHub Desktop.
Save jicksta/2243919 to your computer and use it in GitHub Desktop.
Create origin lines in ThreeJS
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