From 84b23c10aa3fb7d526431cae5fc2a348d25a5b47 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Wed, 25 Oct 2017 04:46:31 -0700 Subject: [PATCH] Small bug fixes, checkbox --- static/scripts/editor.js | 4 ++-- static/scripts/gui.js | 4 ++-- static/scripts/materials.js | 2 +- templates/index.html | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/static/scripts/editor.js b/static/scripts/editor.js index d676cf2..57be609 100644 --- a/static/scripts/editor.js +++ b/static/scripts/editor.js @@ -133,8 +133,8 @@ editor.onKey = function(evt) { editor.gridTimeOut = 0; } if (evt.keyCode === 67) { - materials.curveProperties.splineDensity = materials.curveProperties.splineDensity == 10 ? 1 : 10; - gui.render(); + curvy.checked = !curvy.checked; + api.poll(); } }; diff --git a/static/scripts/gui.js b/static/scripts/gui.js index dbe5edb..905a941 100644 --- a/static/scripts/gui.js +++ b/static/scripts/gui.js @@ -3,7 +3,7 @@ gui.prepare = function() { gui.renderer = new THREE.WebGLRenderer({ "antialias": true }); - gui.renderer.setSize(window.innerWidth, window.innerHeight); + gui.renderer.setSize(window.innerWidth, window.innerHeight-5); gui.renderer.setClearColor(0xffffff, 1); document.querySelector("body").appendChild(gui.renderer.domElement); window.addEventListener("resize", gui.onWindowResize, false); @@ -26,7 +26,7 @@ gui.prepare = function() { gui.onWindowResize = function(evt) { gui.camera.aspect = window.innerWidth / window.innerHeight; gui.camera.updateProjectionMatrix(); - gui.renderer.setSize(window.innerWidth, window.innerHeight); + gui.renderer.setSize(window.innerWidth, window.innerHeight-5); gui.render(); }; diff --git a/static/scripts/materials.js b/static/scripts/materials.js index 31cf9f1..1b8fbba 100644 --- a/static/scripts/materials.js +++ b/static/scripts/materials.js @@ -23,8 +23,8 @@ materials.prepare = function() { }; }; - materials.makeCurve = function(a, b) { + materials.curveProperties.splineDensity = curvy.checked ? 10 : 1; console.log("New curve, " + materials.curveProperties.splineDensity); var length = new THREE.Vector3().subVectors(a, b).length(); var bend = new THREE.Vector3(length / materials.curveProperties.curvature, length / materials.curveProperties.curvature, 0); diff --git a/templates/index.html b/templates/index.html index 30b52e1..c45d6e9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -47,6 +47,7 @@
  • Raussendorf
  • Share
  • Download
  • +
  • Curved edges
  • Documentation