Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Amanda Ghassaei
DMDesign
Commits
ffa57146
Commit
ffa57146
authored
Sep 16, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flat shading on octa cells
parent
961f44b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
3 deletions
+63
-3
js/cells/OctaFaceCell.js
js/cells/OctaFaceCell.js
+21
-1
js/cells/OctaRotEdgeCell.js
js/cells/OctaRotEdgeCell.js
+21
-1
js/cells/OctaVertexCell.js
js/cells/OctaVertexCell.js
+21
-1
No files found.
js/cells/OctaFaceCell.js
View file @
ffa57146
...
...
@@ -6,7 +6,27 @@
define
([
'
underscore
'
,
'
three
'
,
'
threeModel
'
,
'
lattice
'
,
'
appState
'
,
'
cell
'
],
function
(
_
,
THREE
,
three
,
lattice
,
appState
,
DMACell
){
var
unitGeo
=
new
THREE
.
OctahedronGeometry
(
1
/
Math
.
sqrt
(
2
));
var
unitGeo
=
new
THREE
.
Geometry
();
unitGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
-
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
-
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
0.7071067811865475
),
new
THREE
.
Vector3
(
0
,
0
,
-
0.7071067811865475
)
];
unitGeo
.
faces
=
[
new
THREE
.
Face3
(
2
,
4
,
0
),
new
THREE
.
Face3
(
4
,
3
,
0
),
new
THREE
.
Face3
(
3
,
5
,
0
),
new
THREE
.
Face3
(
5
,
2
,
0
),
new
THREE
.
Face3
(
2
,
5
,
1
),
new
THREE
.
Face3
(
5
,
3
,
1
),
new
THREE
.
Face3
(
3
,
4
,
1
),
new
THREE
.
Face3
(
4
,
2
,
1
)
];
unitGeo
.
computeFaceNormals
();
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationZ
(
-
3
*
Math
.
PI
/
12
));
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationX
(
Math
.
asin
(
2
/
Math
.
sqrt
(
2
)
/
Math
.
sqrt
(
3
))));
...
...
js/cells/OctaRotEdgeCell.js
View file @
ffa57146
...
...
@@ -6,7 +6,27 @@
define
([
'
underscore
'
,
'
three
'
,
'
threeModel
'
,
'
lattice
'
,
'
appState
'
,
'
cell
'
],
function
(
_
,
THREE
,
three
,
lattice
,
appState
,
DMACell
){
var
unitGeo
=
new
THREE
.
OctahedronGeometry
(
1
/
Math
.
sqrt
(
2
));
var
unitGeo
=
new
THREE
.
Geometry
();
unitGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
-
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
-
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
0.7071067811865475
),
new
THREE
.
Vector3
(
0
,
0
,
-
0.7071067811865475
)
];
unitGeo
.
faces
=
[
new
THREE
.
Face3
(
2
,
4
,
0
),
new
THREE
.
Face3
(
4
,
3
,
0
),
new
THREE
.
Face3
(
3
,
5
,
0
),
new
THREE
.
Face3
(
5
,
2
,
0
),
new
THREE
.
Face3
(
2
,
5
,
1
),
new
THREE
.
Face3
(
5
,
3
,
1
),
new
THREE
.
Face3
(
3
,
4
,
1
),
new
THREE
.
Face3
(
4
,
2
,
1
)
];
unitGeo
.
computeFaceNormals
();
unitGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeRotationZ
(
Math
.
PI
/
4
));
function
OctaRotEdgeCell
(
json
,
superCell
){
...
...
js/cells/OctaVertexCell.js
View file @
ffa57146
...
...
@@ -6,7 +6,27 @@
define
([
'
underscore
'
,
'
three
'
,
'
threeModel
'
,
'
lattice
'
,
'
appState
'
,
'
cell
'
],
function
(
_
,
THREE
,
three
,
lattice
,
appState
,
DMACell
){
var
unitGeo
=
new
THREE
.
OctahedronGeometry
(
1
/
Math
.
sqrt
(
2
));
var
unitGeo
=
new
THREE
.
Geometry
();
unitGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
-
0.7071067811865475
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
-
0.7071067811865475
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
0.7071067811865475
),
new
THREE
.
Vector3
(
0
,
0
,
-
0.7071067811865475
)
];
unitGeo
.
faces
=
[
new
THREE
.
Face3
(
2
,
4
,
0
),
new
THREE
.
Face3
(
4
,
3
,
0
),
new
THREE
.
Face3
(
3
,
5
,
0
),
new
THREE
.
Face3
(
5
,
2
,
0
),
new
THREE
.
Face3
(
2
,
5
,
1
),
new
THREE
.
Face3
(
5
,
3
,
1
),
new
THREE
.
Face3
(
3
,
4
,
1
),
new
THREE
.
Face3
(
4
,
2
,
1
)
];
unitGeo
.
computeFaceNormals
();
function
OctaVertexCell
(
json
,
superCell
){
DMACell
.
call
(
this
,
json
,
superCell
);
...
...
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