Commit 124944a9 authored by amandaghassaei's avatar amandaghassaei

eod

parent 87df5200
......@@ -99,17 +99,17 @@ function initControls(globals){
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.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.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.creaseMaterialHasChanged = true;
});
......
......@@ -39,9 +39,9 @@ function initGlobals(){
//sim settings
creasePercent: 0.5,
axialStiffness: 2000,
creaseStiffness: 70,
panelStiffness: 70,
axialStiffness: 20,
creaseStiffness: 0.7,
panelStiffness: 0.7,
//dynamic sim settings
percentDamping: 1,
......
......@@ -17,6 +17,6 @@ $(function() {
globals.staticSolver = initStaticSolver(globals);
globals.dynamicSolver = initDynamicSolver(globals);
globals.pattern = initPattern(globals);
globals.vive = initViveInterface(globals);
// globals.vive = initViveInterface(globals);
$(".demo[data-url='Tessellations/waterbomb.svg']").click();
});
\ No newline at end of file
......@@ -172,9 +172,9 @@ function initModel(globals){
function setGeoUpdates(){
geometry.attributes.position.needsUpdate = true;
if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true;
geometry.computeVertexNormals();
else geometry.computeVertexNormals();
// geometry.computeBoundingBox();
geometry.computeBoundingSphere();
// geometry.computeBoundingSphere();
}
var inited = false;
......
......@@ -7,7 +7,7 @@ function initThreeView(globals) {
var scene = new THREE.Scene();
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 renderer = new THREE.WebGLRenderer({antialias: true});
var svgRenderer = new THREE.SVGRenderer();
......@@ -54,15 +54,15 @@ function initThreeView(globals) {
scene.add(camera);
camera.zoom = 25;
camera.zoom = 30;
camera.updateProjectionMatrix();
camera.position.x = 10;
camera.position.y = 10;
camera.position.z = 10;
controls = new THREE.TrackballControls(camera, renderer.domElement);
controls.rotateSpeed = 1.0;
controls.zoomSpeed = 1.2;
controls.rotateSpeed = 4.0;
controls.zoomSpeed = 15;
controls.noPan = true;
controls.staticMoving = true;
controls.dynamicDampingFactor = 0.3;
......@@ -97,6 +97,7 @@ function initThreeView(globals) {
function render() {
if (!animationRunning) {
console.log("render");
_render();
}
}
......@@ -108,10 +109,7 @@ function initThreeView(globals) {
return;
}
animationRunning = true;
_loop(function(){
callback();
_render();
});
_loop(callback);
}
......@@ -146,9 +144,9 @@ function initThreeView(globals) {
globals.vive.effect.requestAnimationFrame(function(){
_loop(callback);
});
_render();
return;
}
controls.update();//todo put this above callback?
requestAnimationFrame(function(){
if (pauseFlag) {
pauseFlag = false;
......@@ -159,6 +157,8 @@ function initThreeView(globals) {
}
_loop(callback);
});
controls.update();
_render();
}
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