From 46cacdbac3dfe9baaa0c3fee05569f481cb0b925 Mon Sep 17 00:00:00 2001 From: amandaghassaei <amandaghassaei@gmail.com> Date: Thu, 15 Mar 2018 06:45:07 -0700 Subject: [PATCH] benchmarking dynamics --- index.html | 2 +- js/controls.js | 2 +- js/dynamic/dynamicSolver.js | 3 +++ js/globals.js | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8c6fe63..f7bb9b7 100755 --- a/index.html +++ b/index.html @@ -376,7 +376,7 @@ } vec3 velocity = force*u_dt/mass[0] + lastVelocity; - gl_FragColor = vec4(velocity,nodeError); + gl_FragColor = vec4(velocity,length(velocity)*length(velocity)); } </script> diff --git a/js/controls.js b/js/controls.js index 8fdc585..89ac76d 100755 --- a/js/controls.js +++ b/js/controls.js @@ -443,7 +443,7 @@ function initControls(globals){ globals.creaseMaterialHasChanged = true; }); - setSliderInput("#percentDamping", globals.percentDamping, 0.1, 1, 0.01, function(val){ + setSliderInput("#percentDamping", globals.percentDamping, 0, 1, 0.01, function(val){ globals.percentDamping = val; globals.materialHasChanged = true; }); diff --git a/js/dynamic/dynamicSolver.js b/js/dynamic/dynamicSolver.js index 50e890f..0e800f9 100755 --- a/js/dynamic/dynamicSolver.js +++ b/js/dynamic/dynamicSolver.js @@ -183,6 +183,8 @@ function initDynamicSolver(globals){ return avgPosition; } + window.ke = []; + function render(){ // var vectorLength = 2; @@ -242,6 +244,7 @@ function initDynamicSolver(globals){ colors[3*i+2] = color.b; } } + window.ke.push(globalError); $errorOutput.html((globalError/nodes.length).toFixed(7) + " %"); } else { console.log("shouldn't be here"); diff --git a/js/globals.js b/js/globals.js index 143228d..47c455c 100755 --- a/js/globals.js +++ b/js/globals.js @@ -81,7 +81,7 @@ function initGlobals(){ userInteractionEnabled: false, vrEnabled: false, - numSteps: 100, + numSteps: 10, rotateModel: null, rotationSpeed: 0.01, -- GitLab