Commit 438e1bc8 authored by amandaghassaei's avatar amandaghassaei
Browse files

cleaning up

parent aed802b3
......@@ -307,17 +307,23 @@
float triangleStiffness = 0.1;
anglesDiff *= triangleStiffness;
if (faceIndex == 0){//a
force -= anglesDiff[0]*(cross(normal, ac)/lengthAC - cross(normal, ab)/lengthAB);
force += anglesDiff[1]*cross(normal, -ab)/lengthAB;
force -= anglesDiff[2]*cross(normal, -ac)/lengthAC;
vec3 normalCrossAC = cross(normal, ac)/lengthAC;
vec3 normalCrossAB = cross(normal, ab)/lengthAB;
force -= anglesDiff[0]*(normalCrossAC - normalCrossAB);
force -= anglesDiff[1]*normalCrossAB;
force += anglesDiff[2]*normalCrossAC;
} else if (faceIndex == 1){
force -= anglesDiff[0]*cross(normal, ab)/lengthAB;
force -= anglesDiff[1]*(cross(normal, -ab)/lengthAB - cross(normal, bc)/lengthBC);
force += anglesDiff[2]*cross(normal, -bc)/lengthBC;
vec3 normalCrossAB = cross(normal, ab)/lengthAB;
vec3 normalCrossBC = cross(normal, bc)/lengthBC;
force -= anglesDiff[0]*normalCrossAB;
force += anglesDiff[1]*(normalCrossAB + normalCrossBC);
force -= anglesDiff[2]*normalCrossBC;
} else if (faceIndex == 2){
force += anglesDiff[0]*cross(normal, ac)/lengthAC;
force -= anglesDiff[1]*cross(normal, bc)/lengthBC;
force -= anglesDiff[2]*(cross(normal, -bc)/lengthBC - cross(normal, -ac)/lengthAC);
vec3 normalCrossAC = cross(normal, ac)/lengthAC;
vec3 normalCrossBC = cross(normal, bc)/lengthBC;
force += anglesDiff[0]*normalCrossAC;
force -= anglesDiff[1]*normalCrossBC;
force += anglesDiff[2]*(normalCrossBC - normalCrossAC);
}
}
......@@ -668,10 +674,10 @@
<span class="label-slider">Axial Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
<input value="" placeholder="" class="form-control" type="text">
</div>
<div class="sliderInput paddingBottom" id="triStiffness">
<span class="label-slider">Triangle Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
<input value="" placeholder="" class="form-control" type="text">
</div>
<!--<div class="sliderInput paddingBottom" id="triStiffness">-->
<!--<span class="label-slider">Triangle Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>-->
<!--<input value="" placeholder="" class="form-control" type="text">-->
<!--</div>-->
<div class="sliderInput" id="creaseStiffness">
<span class="label-slider">Fold Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
<input value="" placeholder="" class="form-control" type="text">
......
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