Commit c36266e0 authored by amandaghassaei's avatar amandaghassaei
Browse files

trying out dynamic sim

parent 39ac1751
......@@ -283,6 +283,9 @@
<script type="text/javascript" src="js/crease.js"></script>
<script type="text/javascript" src="js/model.js"></script>
<script type="text/javascript" src="js/staticSolver.js"></script>
<script type="text/javascript" src="js/dynamic/dynamicModel.js"></script>
<script type="text/javascript" src="js/dynamic/GLBoilerplate.js"></script>
<script type="text/javascript" src="js/dynamic/GPUMath.js"></script>
<script type="text/javascript" src="js/pattern.js"></script>
<script type="text/javascript" src="js/main.js"></script>
......
......@@ -4,6 +4,8 @@
function initDynamicModel(globals){
globals.gpuMath =initGPUMath();
var material = new THREE.MeshNormalMaterial({shading: THREE.FlatShading, side: THREE.DoubleSide});
var geometry = new THREE.Geometry();
geometry.dynamic = true;
......@@ -201,8 +203,6 @@ function initDynamicModel(globals){
} else {
console.log("here");
}
//globals.gpuMath.setSize(textureDim, textureDim);
}
function setSolveParams(){
......
......@@ -120,7 +120,8 @@ $(function() {
globals = initGlobals();
globals.model = initModel(globals);
globals.staticSolver = initStaticSolver(globals);
globals.staticSolver.syncNodesAndEdges();
globals.dynamicSolver = initDynamicModel(globals);
// globals.staticSolver.syncNodesAndEdges();
globals.pattern = initPattern(globals);
globals.threeView.render();
// globals.threeView.sceneAdd(raycasterPlane);
......
......@@ -12,7 +12,7 @@ function initModel(globals){
nodes.push(new Node(new THREE.Vector3(0,0,10), nodes.length));
nodes.push(new Node(new THREE.Vector3(10,0,0), nodes.length));
nodes.push(new Node(new THREE.Vector3(0,0,-10), nodes.length));
nodes.push(new Node(new THREE.Vector3(10,0,-10), nodes.length));
// nodes.push(new Node(new THREE.Vector3(10,0,-10), nodes.length));
nodes[0].setFixed(true);
nodes[1].setFixed(true);
nodes[2].setFixed(true);
......@@ -23,17 +23,17 @@ function initModel(globals){
edges.push(new Beam([nodes[2], nodes[0]]));
edges.push(new Beam([nodes[3], nodes[0]]));
edges.push(new Beam([nodes[3], nodes[2]]));
edges.push(new Beam([nodes[3], nodes[4]]));
edges.push(new Beam([nodes[2], nodes[4]]));
// edges.push(new Beam([nodes[3], nodes[4]]));
// edges.push(new Beam([nodes[2], nodes[4]]));
var faces = [];
faces.push(new THREE.Face3(0,1,2));
faces.push(new THREE.Face3(0,2,3));
faces.push(new THREE.Face3(4,3,2));
// faces.push(new THREE.Face3(4,3,2));
var creases = [];
creases.push(new Crease(edges[2], 0, 1, Math.PI-0.001, 1, nodes[1], nodes[3], 0));
creases.push(new Crease(edges[4], 2, 1, -(Math.PI-0.001), 1, nodes[4], nodes[0], 1));
// creases.push(new Crease(edges[4], 2, 1, -(Math.PI-0.001), 1, nodes[4], nodes[0], 1));
var _allNodeObject3Ds = [];
_.each(nodes, function(node){
......
Supports Markdown
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