Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
22063272
Commit
22063272
authored
May 02, 2017
by
amandaghassaei
Browse files
small changes
parent
db4c54d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
22063272
...
...
@@ -422,8 +422,8 @@
Colored Material
</label>
<div
id=
"coloredMaterialOptions"
class=
"indent"
>
<label>
Color 1 (rgb hex):
</label><input
id=
"color1"
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
><br/>
<label>
Color 2 (rgb hex):
</label><input
id=
"color2"
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
><br/>
<label>
Color 1 (rgb hex):
</label><input
id=
"color1"
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
><br/>
<label>
Color 2 (rgb hex):
</label><input
id=
"color2"
value=
""
placeholder=
""
class=
"form-control"
type=
"text"
><br/>
</div>
<label
class=
"radio"
>
<input
name=
"colorMode"
value=
"normal"
data-toggle=
"radio"
class=
"custom-radio"
type=
"radio"
><span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
...
...
js/globals.js
View file @
22063272
...
...
@@ -8,7 +8,7 @@ function initGlobals(){
var
_globals
=
{
//view
colorMode
:
"
normal
"
,
colorMode
:
"
color
"
,
color1
:
"
ec008b
"
,
color2
:
"
ffffff
"
,
...
...
js/model.js
View file @
22063272
...
...
@@ -9,14 +9,14 @@ function initModel(globals){
setMeshMaterial
();
function
setMeshMaterial
(){
if
(
globals
.
colorMode
==
"
normal
"
){
material
=
new
THREE
.
MeshNormalMaterial
({
shading
:
THREE
.
FlatShading
,
side
:
THREE
.
DoubleSide
});
material
=
new
THREE
.
MeshNormalMaterial
({
side
:
THREE
.
DoubleSide
});
}
else
{
material
=
THREE
.
MeshFaceMaterial
([
new
THREE
.
MeshLambertMaterial
({
shading
:
THREE
.
FlatShading
,
color
:
0xff0000
,
side
:
THREE
.
FrontSide
}),
new
THREE
.
MeshLambertMaterial
({
shading
:
THREE
.
FlatShading
,
color
:
0x0000ff
,
side
:
THREE
.
FrontSide
})
]);
material
.
materials
[
0
].
color
.
setStyle
(
"
#
"
+
globals
.
color
1
);
material
.
materials
[
1
].
color
.
setStyle
(
"
#
"
+
globals
.
color
2
);
material
.
materials
[
0
].
color
.
setStyle
(
"
#
"
+
globals
.
color
2
);
material
.
materials
[
1
].
color
.
setStyle
(
"
#
"
+
globals
.
color
1
);
}
if
(
object3D
)
object3D
.
material
=
material
;
}
...
...
@@ -102,6 +102,7 @@ function initModel(globals){
}
geometry
.
verticesNeedUpdate
=
true
;
geometry
.
computeFaceNormals
();
geometry
.
computeFlatVertexNormals
();
});
}
...
...
@@ -180,6 +181,7 @@ function initModel(globals){
geometry
.
computeFaceNormals
();
geometry
.
computeBoundingBox
();
geometry
.
computeBoundingSphere
();
geometry
.
center
();
globals
.
shouldSyncWithModel
=
true
;
inited
=
true
;
...
...
Write
Preview
Markdown
is supported
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