Commit a66ff6eb authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent bd4453c9
......@@ -305,11 +305,10 @@
if (diff < -5.0) {
diff += TWO_PI;
} else if (diff > 5.0) {
diff -= TWO_PI;
diff -= TWO_PI;
}
//if (abs(diff)>0.01) diff = 0.0;
theta = lastTheta[0] + diff;
gl_FragColor = vec4(theta, origDiff, lastTheta[2], lastTheta[3]);//[theta, w, normal1Index, normal2Index]
gl_FragColor = vec4(theta, diff, lastTheta[2], lastTheta[3]);//[theta, w, normal1Index, normal2Index]
}
</script>
......@@ -540,7 +539,7 @@
<b>Animation Settings:</b><a class="about floatRight" href="#" id="aboutAnimation"><span class="fui-question-circle"></span></a><br/>
<div class="indent">
<span class="smallTxt">&Delta; t = <span id="deltaT"></span> seconds</span><br/>
<span class="smallTxt">Num steps per render: &nbsp;&nbsp;<input id="numStepsPerRender" value="" placeholder="" class="int form-control" type="text"></span><br/><br/>
<span class="smallTxt">Num simulation steps per render: &nbsp;&nbsp;<input id="numStepsPerRender" value="" placeholder="" class="int form-control" type="text"></span><br/><br/>
<a href="#" id="shouldCenterGeo" class="floatRight btn btn-lg btn-default">Re-center geometry</a>
</div>
<div class="extraSpace"></div>
......@@ -727,7 +726,7 @@
This is especially cool if you set the mesh material to <b>Axial Strain Visualization</b> so you can see how your interactions
change the internal strains in the material.
<br/><br/>
If the simulation looks choppy, consider lowering the <b>Num steps per render</b> setting in the right hand menu.
If the simulation looks choppy, consider lowering the <b>Num simulation per render</b> setting in the right hand menu.
</p>
</div>
</div><!-- /.modal-content -->
......@@ -746,7 +745,7 @@
based on the material stiffnesses set in the <b>Stiffness Settings</b> section: more stiff settings
require shorter time steps to solve and will slow down the simulation.<br/>
<br/>
<b>Num steps per render</b> allows you to control the number of tiny time steps forward to take on each
<b>Num simulation steps per render</b> allows you to control the number of tiny time steps forward to take on each
render cycle. If the simulation looks choppy to you, you might consider lowering this setting.
Lowering the number of steps per render will slow down the simulation, but will result in a more smooth animation.
</p>
......
......@@ -158,28 +158,28 @@ function initDynamicSolver(globals){
function render(){
// var vectorLength = 2;
// globals.gpuMath.setProgram("packToBytes");
// globals.gpuMath.setUniformForProgram("packToBytes", "u_vectorLength", vectorLength, "1f");
// globals.gpuMath.setUniformForProgram("packToBytes", "u_floatTextureDim", [textureDimCreases, textureDimCreases], "2f");
// globals.gpuMath.setSize(textureDimCreases*vectorLength, textureDimCreases);
// globals.gpuMath.step("packToBytes", ["u_lastTheta"], "outputBytes");
//
// if (globals.gpuMath.readyToRead()) {
// var numPixels = nodes.length*vectorLength;
// var height = Math.ceil(numPixels/(textureDimCreases*vectorLength));
// var pixels = new Uint8Array(height*textureDimCreases*4*vectorLength);
// globals.gpuMath.readPixels(0, 0, textureDimCreases * vectorLength, height, pixels);
// var parsedPixels = new Float32Array(pixels.buffer);
// for (var i=0;i<parsedPixels.length;i+=2){
// if (Math.abs(parsedPixels[i])>Math.PI) {
// console.log(creases[i]);
// }
//
// }
// } else {
// console.log("here");
// }
var vectorLength = 2;
globals.gpuMath.setProgram("packToBytes");
globals.gpuMath.setUniformForProgram("packToBytes", "u_vectorLength", vectorLength, "1f");
globals.gpuMath.setUniformForProgram("packToBytes", "u_floatTextureDim", [textureDimCreases, textureDimCreases], "2f");
globals.gpuMath.setSize(textureDimCreases*vectorLength, textureDimCreases);
globals.gpuMath.step("packToBytes", ["u_lastTheta"], "outputBytes");
if (globals.gpuMath.readyToRead()) {
var numPixels = nodes.length*vectorLength;
var height = Math.ceil(numPixels/(textureDimCreases*vectorLength));
var pixels = new Uint8Array(height*textureDimCreases*4*vectorLength);
globals.gpuMath.readPixels(0, 0, textureDimCreases * vectorLength, height, pixels);
var parsedPixels = new Float32Array(pixels.buffer);
for (var i=0;i<parsedPixels.length;i+=2){
if (Math.abs(parsedPixels[i])>Math.PI) {
console.log(parsedPixels[i+1]);//theta
}
}
} else {
console.log("here");
}
var vectorLength = 4;
globals.gpuMath.setProgram("packToBytes");
......
......@@ -219,15 +219,16 @@ function initPattern(globals){
removeRedundantVertices(outlines.concat(mountains).concat(valleys).concat(cuts).concat(triangulations));
var allEdges = outlines.concat(mountains).concat(valleys).concat(cuts).concat(triangulations);
var preTriLength = allEdges.length;
polygons = findPolygons(allEdges);
var faces = triangulatePolys(polygons, allEdges);
$("#numMtns").html("(" + mountains.length + ")");
$("#numValleys").html("(" + valleys.length + ")");
$("#numFacets").html("(" + triangulations.length + ")");
$("#numFacets").html("(" + (triangulations.length+allEdges.length-preTriLength) + ")");
$("#numPassive").html("(" + outlines.length + ")");
polygons = findPolygons(allEdges);
var faces = triangulatePolys(polygons, allEdges);
var allCreaseParams = getFacesAndVerticesForEdges(faces, allEdges);
globals.model.buildModel(faces, vertices, allEdges, allCreaseParams);
}
......
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