From 0b684d389f06e919c3adee18457a2e53b96d4621 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Fri, 11 Sep 2015 12:20:15 -0700 Subject: [PATCH] adding XYZ axises --- web/app/3d/viewer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/app/3d/viewer.js b/web/app/3d/viewer.js index 6a08f80e..58308375 100644 --- a/web/app/3d/viewer.js +++ b/web/app/3d/viewer.js @@ -87,6 +87,17 @@ TCAD.Viewer = function(bus) { } } + function addAxis(axis, color) { + var lineMaterial = new THREE.LineBasicMaterial({color: color, linewidth: 1}); + var axisGeom = new THREE.Geometry(); + axisGeom.vertices.push(axis.multiply(-1000)); + axisGeom.vertices.push(axis.multiply(1000)); + scene.add(new THREE.Segment(axisGeom, lineMaterial)); + } + addAxis(TCAD.math.AXIS.X, 0xFF0000); + addAxis(TCAD.math.AXIS.Y, 0x00FF00); + addAxis(TCAD.math.AXIS.Z, 0x0000FF); + function updateControlsAndHelpers() { trackballControls.update(); updateTransformControls();