Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
0c4e74bf
Commit
0c4e74bf
authored
9 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
materials parent class
parent
5b53cd1b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/main.js
+1
-0
1 addition, 0 deletions
js/main.js
js/materials/DMAMaterials.js
+36
-0
36 additions, 0 deletions
js/materials/DMAMaterials.js
js/materials/ElectronicMaterials.js
+8
-25
8 additions, 25 deletions
js/materials/ElectronicMaterials.js
with
45 additions
and
25 deletions
js/main.js
+
1
−
0
View file @
0c4e74bf
...
...
@@ -66,6 +66,7 @@ require.config({
gikSuperCell
:
'
cells/supercells/GIKSuperCell
'
,
//materials
materials
:
'
materials/DMAMaterials
'
,
electronicMaterials
:
'
materials/ElectronicMaterials
'
,
//UI
...
...
This diff is collapsed.
Click to expand it.
js/materials/DMAMaterials.js
0 → 100644
+
36
−
0
View file @
0c4e74bf
/**
* Created by aghassaei on 6/4/15.
*/
define
([
'
underscore
'
,
'
three
'
,
'
appState
'
],
function
(
_
,
THREE
,
appState
){
function
DMAMaterials
(
materialList
){
this
.
materials
=
{};
this
.
materialList
=
materialList
;
this
.
changeMaterials
();
}
DMAMaterials
.
prototype
.
changeMaterials
=
function
(){
var
self
=
this
;
_
.
each
(
_
.
keys
(
self
.
materialList
),
function
(
material
){
if
(
appState
.
get
(
"
realisticColorScheme
"
))
{
if
(
self
.
materials
[
material
])
self
.
materials
[
material
].
color
=
new
THREE
.
Color
(
self
.
materialList
[
material
].
color
);
else
self
.
materials
[
material
]
=
new
THREE
.
MeshLambertMaterial
({
color
:
self
.
materialList
[
material
].
color
});
if
(
self
.
materialList
[
material
].
opacity
){
self
.
materials
[
material
].
transparent
=
true
;
self
.
materials
[
material
].
opacity
=
self
.
materialList
[
material
].
opacity
;
}
else
{
self
.
materials
[
material
].
transparent
=
false
;
}
}
else
{
if
(
self
.
materials
[
material
])
self
.
materials
[
material
].
color
=
new
THREE
.
Color
(
self
.
materialList
[
material
].
altColor
);
else
self
.
materials
[
material
]
=
new
THREE
.
MeshLambertMaterial
({
color
:
self
.
materialList
[
material
].
altColor
});
self
.
materials
[
material
].
transparent
=
false
;
}
});
};
return
DMAMaterials
;
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/materials/ElectronicMaterials.js
+
8
−
25
View file @
0c4e74bf
...
...
@@ -3,34 +3,17 @@
*/
define
([
'
underscore
'
,
'
three
'
,
'
appState
'
,
'
plist
'
],
function
(
_
,
THREE
,
appState
,
plist
){
define
([
'
underscore
'
,
'
three
'
,
'
appState
'
,
'
plist
'
,
'
materials
'
],
function
(
_
,
THREE
,
appState
,
plist
,
DMAMaterials
){
var
materials
=
{};
var
materialList
=
plist
.
allMaterialTypes
.
cube
.
gik
;
function
changeMaterials
(){
_
.
each
(
_
.
keys
(
materialList
),
function
(
material
){
if
(
appState
.
get
(
"
realisticColorScheme
"
))
{
if
(
materials
[
material
])
materials
[
material
].
color
=
new
THREE
.
Color
(
materialList
[
material
].
color
);
else
materials
[
material
]
=
new
THREE
.
MeshLambertMaterial
({
color
:
materialList
[
material
].
color
});
if
(
materialList
[
material
].
opacity
){
materials
[
material
].
transparent
=
true
;
materials
[
material
].
opacity
=
materialList
[
material
].
opacity
;
}
else
{
materials
[
material
].
transparent
=
false
;
}
}
else
{
if
(
materials
[
material
])
materials
[
material
].
color
=
new
THREE
.
Color
(
materialList
[
material
].
altColor
);
else
materials
[
material
]
=
new
THREE
.
MeshLambertMaterial
({
color
:
materialList
[
material
].
altColor
});
materials
[
material
].
transparent
=
false
;
}
});
function
ElectronicMaterials
(){
DMAMaterials
.
call
(
this
,
plist
.
allMaterialTypes
.
cube
.
gik
);
}
changeMaterials
();
ElectronicMaterials
.
prototype
=
Object
.
create
(
DMAMaterials
.
prototype
);
var
material
=
new
ElectronicMaterials
();
return
{
changeMaterials
:
changeMaterials
,
materials
:
materials
changeMaterials
:
material
.
changeMaterials
,
materials
:
material
.
materials
}
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment