Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
e0adec0b
Commit
e0adec0b
authored
Mar 06, 2017
by
amandaghassaei
Browse files
debugging
parent
f040ca36
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
e0adec0b
...
...
@@ -253,11 +253,8 @@
vec3
creaseVector
=
texture2D
(
u_creaseVectors
,
scaledFragCoord
).
xyz
;
float
sign
=
dot
(
cross
(
normal1
,
normal2
),
creaseVector
);
if
(
sign
<
0.0
)
theta
*=
-
1.0
;
if
(
lastTheta
[
1
]
<
0.0
){
//decreasing
if
(
theta
>
1.0
&&
lastTheta
[
0
]
<
-
1.0
)
theta
-=
2.0
*
M_PI
*
(
1.0
+
mod
(
lastTheta
[
0
],
2.0
*
M_PI
));
}
else
{
//increasing
if
(
theta
<
-
1.0
&&
lastTheta
[
0
]
>
1.0
)
theta
+=
2.0
*
M_PI
*
(
1.0
+
mod
(
lastTheta
[
0
],
2.0
*
M_PI
));
}
if
(
theta
>
3.0
&&
lastTheta
[
0
]
<
-
3.0
)
theta
-=
2.0
*
M_PI
*
(
1.0
+
floor
(
lastTheta
[
0
]
/
2.0
*
M_PI
));
if
(
theta
<
-
3.0
&&
lastTheta
[
0
]
>
3.0
)
theta
+=
2.0
*
M_PI
*
(
1.0
+
floor
(
lastTheta
[
0
]
/
2.0
*
M_PI
));
gl_FragColor
=
vec4
(
theta
,
theta
-
lastTheta
[
0
],
lastTheta
[
2
],
lastTheta
[
3
]);
//[theta, w, normal1Index, normal2Index]
}
</script>
...
...
@@ -362,20 +359,20 @@
<div
id=
"controls"
>
<div
class=
"sliderInput"
id=
"creasePercent"
>
<span
class=
"label-slider"
>
Crease Percent :
</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
int
"
type=
"text"
>
<input
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
>
</div>
<br/><br/><br/>
<div
class=
"sliderInput"
id=
"axialStiffness"
>
<span
class=
"label-slider"
>
Axial Stiffness :
</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
int
"
type=
"text"
>
<input
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
>
</div>
<div
class=
"sliderInput"
id=
"creaseStiffness"
>
<span
class=
"label-slider"
>
Crease Stiffness :
</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
int
"
type=
"text"
>
<input
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
>
</div>
<div
class=
"sliderInput"
id=
"panelStiffness"
>
<span
class=
"label-slider"
>
Panel Stiffness :
</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
int
"
type=
"text"
>
<input
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
>
</div>
<div
id=
"svgViewer"
></div>
<div
class=
"extraSpace"
></div>
...
...
js/model.js
View file @
e0adec0b
...
...
@@ -46,7 +46,7 @@ function initModel(globals){
}
var
_creases
=
[];
for
(
var
i
=
0
;
i
<
1
;
i
++
)
{
for
(
var
i
=
0
;
i
<
1
;
i
++
)
{
//allCreaseParams.length
var
creaseParams
=
allCreaseParams
[
i
];
//face1Ind, vertInd, face2Ind, ver2Ind, edgeInd, angle
_edges
[
creaseParams
[
4
]].
highlight
();
_creases
.
push
(
new
Crease
(
_edges
[
creaseParams
[
4
]],
creaseParams
[
0
],
creaseParams
[
2
],
creaseParams
[
5
],
1
,
_nodes
[
creaseParams
[
1
]],
_nodes
[
creaseParams
[
3
]],
_creases
.
length
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment