Commit 124944a9 authored by amandaghassaei's avatar amandaghassaei

eod

parent 87df5200
...@@ -99,17 +99,17 @@ function initControls(globals){ ...@@ -99,17 +99,17 @@ function initControls(globals){
globals.simType = val; globals.simType = val;
}); });
setSliderInput("#axialStiffness", globals.axialStiffness, 1000, 4000, 1, function(val){ setSliderInput("#axialStiffness", globals.axialStiffness, 10, 40, 1, function(val){
globals.axialStiffness = val; globals.axialStiffness = val;
globals.materialHasChanged = true; globals.materialHasChanged = true;
}); });
setSliderInput("#creaseStiffness", globals.creaseStiffness, 0, 100, 1, function(val){ setSliderInput("#creaseStiffness", globals.creaseStiffness, 0, 1, 0.01, function(val){
globals.creaseStiffness = val; globals.creaseStiffness = val;
globals.creaseMaterialHasChanged = true; globals.creaseMaterialHasChanged = true;
}); });
setSliderInput("#panelStiffness", globals.panelStiffness, 0, 100, 1, function(val){ setSliderInput("#panelStiffness", globals.panelStiffness, 0, 1, 0.01, function(val){
globals.panelStiffness = val; globals.panelStiffness = val;
globals.creaseMaterialHasChanged = true; globals.creaseMaterialHasChanged = true;
}); });
......
...@@ -39,9 +39,9 @@ function initGlobals(){ ...@@ -39,9 +39,9 @@ function initGlobals(){
//sim settings //sim settings
creasePercent: 0.5, creasePercent: 0.5,
axialStiffness: 2000, axialStiffness: 20,
creaseStiffness: 70, creaseStiffness: 0.7,
panelStiffness: 70, panelStiffness: 0.7,
//dynamic sim settings //dynamic sim settings
percentDamping: 1, percentDamping: 1,
......
...@@ -17,6 +17,6 @@ $(function() { ...@@ -17,6 +17,6 @@ $(function() {
globals.staticSolver = initStaticSolver(globals); globals.staticSolver = initStaticSolver(globals);
globals.dynamicSolver = initDynamicSolver(globals); globals.dynamicSolver = initDynamicSolver(globals);
globals.pattern = initPattern(globals); globals.pattern = initPattern(globals);
globals.vive = initViveInterface(globals); // globals.vive = initViveInterface(globals);
$(".demo[data-url='Tessellations/waterbomb.svg']").click(); $(".demo[data-url='Tessellations/waterbomb.svg']").click();
}); });
\ No newline at end of file
...@@ -172,9 +172,9 @@ function initModel(globals){ ...@@ -172,9 +172,9 @@ function initModel(globals){
function setGeoUpdates(){ function setGeoUpdates(){
geometry.attributes.position.needsUpdate = true; geometry.attributes.position.needsUpdate = true;
if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true; if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true;
geometry.computeVertexNormals(); else geometry.computeVertexNormals();
// geometry.computeBoundingBox(); // geometry.computeBoundingBox();
geometry.computeBoundingSphere(); // geometry.computeBoundingSphere();
} }
var inited = false; var inited = false;
......
...@@ -7,7 +7,7 @@ function initThreeView(globals) { ...@@ -7,7 +7,7 @@ function initThreeView(globals) {
var scene = new THREE.Scene(); var scene = new THREE.Scene();
var modelWrapper = new THREE.Object3D(); var modelWrapper = new THREE.Object3D();
var camera = new THREE.PerspectiveCamera(70, window.innerWidth/window.innerHeight, 0.01, 1000); var camera = new THREE.PerspectiveCamera(70, window.innerWidth/window.innerHeight, 0.1, 100);
// var camera = new THREE.OrthographicCamera(window.innerWidth / -2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / -2, -10000, 10000);//-40, 40); // var camera = new THREE.OrthographicCamera(window.innerWidth / -2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / -2, -10000, 10000);//-40, 40);
var renderer = new THREE.WebGLRenderer({antialias: true}); var renderer = new THREE.WebGLRenderer({antialias: true});
var svgRenderer = new THREE.SVGRenderer(); var svgRenderer = new THREE.SVGRenderer();
...@@ -54,15 +54,15 @@ function initThreeView(globals) { ...@@ -54,15 +54,15 @@ function initThreeView(globals) {
scene.add(camera); scene.add(camera);
camera.zoom = 25; camera.zoom = 30;
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
camera.position.x = 10; camera.position.x = 10;
camera.position.y = 10; camera.position.y = 10;
camera.position.z = 10; camera.position.z = 10;
controls = new THREE.TrackballControls(camera, renderer.domElement); controls = new THREE.TrackballControls(camera, renderer.domElement);
controls.rotateSpeed = 1.0; controls.rotateSpeed = 4.0;
controls.zoomSpeed = 1.2; controls.zoomSpeed = 15;
controls.noPan = true; controls.noPan = true;
controls.staticMoving = true; controls.staticMoving = true;
controls.dynamicDampingFactor = 0.3; controls.dynamicDampingFactor = 0.3;
...@@ -97,6 +97,7 @@ function initThreeView(globals) { ...@@ -97,6 +97,7 @@ function initThreeView(globals) {
function render() { function render() {
if (!animationRunning) { if (!animationRunning) {
console.log("render");
_render(); _render();
} }
} }
...@@ -108,10 +109,7 @@ function initThreeView(globals) { ...@@ -108,10 +109,7 @@ function initThreeView(globals) {
return; return;
} }
animationRunning = true; animationRunning = true;
_loop(function(){ _loop(callback);
callback();
_render();
});
} }
...@@ -146,9 +144,9 @@ function initThreeView(globals) { ...@@ -146,9 +144,9 @@ function initThreeView(globals) {
globals.vive.effect.requestAnimationFrame(function(){ globals.vive.effect.requestAnimationFrame(function(){
_loop(callback); _loop(callback);
}); });
_render();
return; return;
} }
controls.update();//todo put this above callback?
requestAnimationFrame(function(){ requestAnimationFrame(function(){
if (pauseFlag) { if (pauseFlag) {
pauseFlag = false; pauseFlag = false;
...@@ -159,6 +157,8 @@ function initThreeView(globals) { ...@@ -159,6 +157,8 @@ function initThreeView(globals) {
} }
_loop(callback); _loop(callback);
}); });
controls.update();
_render();
} }
function sceneAddModel(object){//beams and nodes function sceneAddModel(object){//beams and nodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment