Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Amanda Ghassaei
DMDesign
Commits
2310e25a
Commit
2310e25a
authored
Sep 16, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flat shading on tetra cells
parent
ffa57146
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
js/cells/TetraStackedCell.js
js/cells/TetraStackedCell.js
+14
-1
js/cells/TetraVertexCell.js
js/cells/TetraVertexCell.js
+14
-1
No files found.
js/cells/TetraStackedCell.js
View file @
2310e25a
...
...
@@ -6,7 +6,20 @@
define
([
'
underscore
'
,
'
three
'
,
'
threeModel
'
,
'
lattice
'
,
'
appState
'
,
'
cell
'
],
function
(
_
,
THREE
,
three
,
lattice
,
appState
,
DMACell
){
var
unitGeo
=
new
THREE
.
TetrahedronGeometry
(
Math
.
sqrt
(
3
/
8
));
var
unitGeo
=
new
THREE
.
Geometry
();
unitGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.3535533905932738
,
0.3535533905932738
,
0.3535533905932738
),
new
THREE
.
Vector3
(
-
0.3535533905932738
,
-
0.3535533905932738
,
0.3535533905932738
),
new
THREE
.
Vector3
(
-
0.3535533905932738
,
0.3535533905932738
,
-
0.3535533905932738
),
new
THREE
.
Vector3
(
0.3535533905932738
,
-
0.3535533905932738
,
-
0.3535533905932738
)
];
unitGeo
.
faces
=
[
new
THREE
.
Face3
(
1
,
0
,
2
),
new
THREE
.
Face3
(
3
,
2
,
0
),
new
THREE
.
Face3
(
3
,
0
,
1
),
new
THREE
.
Face3
(
3
,
1
,
2
)
];
unitGeo
.
computeFaceNormals
();
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationZ
(
Math
.
PI
/
4
));
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationX
((
Math
.
PI
-
Math
.
atan
(
2
*
Math
.
sqrt
(
2
)))
/
2
));
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
Math
.
sqrt
(
3
/
8
)
-
2
/
Math
.
sqrt
(
6
)));
...
...
js/cells/TetraVertexCell.js
View file @
2310e25a
...
...
@@ -6,7 +6,20 @@
define
([
'
underscore
'
,
'
three
'
,
'
threeModel
'
,
'
lattice
'
,
'
appState
'
,
'
cell
'
],
function
(
_
,
THREE
,
three
,
lattice
,
appState
,
DMACell
){
var
unitGeo
=
new
THREE
.
TetrahedronGeometry
(
Math
.
sqrt
(
3
/
8
));
var
unitGeo
=
new
THREE
.
Geometry
();
unitGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.3535533905932738
,
0.3535533905932738
,
0.3535533905932738
),
new
THREE
.
Vector3
(
-
0.3535533905932738
,
-
0.3535533905932738
,
0.3535533905932738
),
new
THREE
.
Vector3
(
-
0.3535533905932738
,
0.3535533905932738
,
-
0.3535533905932738
),
new
THREE
.
Vector3
(
0.3535533905932738
,
-
0.3535533905932738
,
-
0.3535533905932738
)
];
unitGeo
.
faces
=
[
new
THREE
.
Face3
(
1
,
0
,
2
),
new
THREE
.
Face3
(
3
,
2
,
0
),
new
THREE
.
Face3
(
3
,
0
,
1
),
new
THREE
.
Face3
(
3
,
1
,
2
)
];
unitGeo
.
computeFaceNormals
();
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationZ
(
Math
.
PI
/
4
));
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationX
((
Math
.
PI
-
Math
.
atan
(
2
*
Math
.
sqrt
(
2
)))
/
2
));
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0
,
Math
.
sqrt
(
3
/
8
)
-
2
/
Math
.
sqrt
(
6
)));
...
...
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