@@ -133,8 +133,8 @@ editor.onKey = function(evt) { | |||||
editor.gridTimeOut = 0; | editor.gridTimeOut = 0; | ||||
} | } | ||||
if (evt.keyCode === 67) { | if (evt.keyCode === 67) { | ||||
materials.curveProperties.splineDensity = materials.curveProperties.splineDensity == 10 ? 1 : 10; | |||||
gui.render(); | |||||
curvy.checked = !curvy.checked; | |||||
api.poll(); | |||||
} | } | ||||
}; | }; | ||||
@@ -3,7 +3,7 @@ gui.prepare = function() { | |||||
gui.renderer = new THREE.WebGLRenderer({ | gui.renderer = new THREE.WebGLRenderer({ | ||||
"antialias": true | "antialias": true | ||||
}); | }); | ||||
gui.renderer.setSize(window.innerWidth, window.innerHeight); | |||||
gui.renderer.setSize(window.innerWidth, window.innerHeight-5); | |||||
gui.renderer.setClearColor(0xffffff, 1); | gui.renderer.setClearColor(0xffffff, 1); | ||||
document.querySelector("body").appendChild(gui.renderer.domElement); | document.querySelector("body").appendChild(gui.renderer.domElement); | ||||
window.addEventListener("resize", gui.onWindowResize, false); | window.addEventListener("resize", gui.onWindowResize, false); | ||||
@@ -26,7 +26,7 @@ gui.prepare = function() { | |||||
gui.onWindowResize = function(evt) { | gui.onWindowResize = function(evt) { | ||||
gui.camera.aspect = window.innerWidth / window.innerHeight; | gui.camera.aspect = window.innerWidth / window.innerHeight; | ||||
gui.camera.updateProjectionMatrix(); | gui.camera.updateProjectionMatrix(); | ||||
gui.renderer.setSize(window.innerWidth, window.innerHeight); | |||||
gui.renderer.setSize(window.innerWidth, window.innerHeight-5); | |||||
gui.render(); | gui.render(); | ||||
}; | }; | ||||
@@ -23,8 +23,8 @@ materials.prepare = function() { | |||||
}; | }; | ||||
}; | }; | ||||
materials.makeCurve = function(a, b) { | materials.makeCurve = function(a, b) { | ||||
materials.curveProperties.splineDensity = curvy.checked ? 10 : 1; | |||||
console.log("New curve, " + materials.curveProperties.splineDensity); | console.log("New curve, " + materials.curveProperties.splineDensity); | ||||
var length = new THREE.Vector3().subVectors(a, b).length(); | var length = new THREE.Vector3().subVectors(a, b).length(); | ||||
var bend = new THREE.Vector3(length / materials.curveProperties.curvature, length / materials.curveProperties.curvature, 0); | var bend = new THREE.Vector3(length / materials.curveProperties.curvature, length / materials.curveProperties.curvature, 0); | ||||
@@ -47,6 +47,7 @@ | |||||
<li><a onclick="editor.raussendorf()">Raussendorf</a></li> | <li><a onclick="editor.raussendorf()">Raussendorf</a></li> | ||||
<li><a onclick="share()">Share</a></li> | <li><a onclick="share()">Share</a></li> | ||||
<li><a href="/{{uuid}}/download">Download</a></li> | <li><a href="/{{uuid}}/download">Download</a></li> | ||||
<li><input id=curvy type="checkbox"></input> Curved edges</li> | |||||
<li><a href="/doc" id=help>Documentation</a></li> | <li><a href="/doc" id=help>Documentation</a></li> | ||||
</ul> | </ul> | ||||
</div> | </div> | ||||