Last active
December 23, 2015 15:39
-
-
Save jlewin/6656476 to your computer and use it in GitHub Desktop.
Random refactoring of some threejs code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| materialGroups = groupedMaterials.map(function (group) { | |
| return group.map(function (name) { return namedMaterials[name]; }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (var g = 0; g < groupedMaterials.length; g++) { | |
| var arr = []; | |
| materialGroups.push(arr); | |
| var group = groupedMaterials[g]; | |
| // Extract each group member and push to group array | |
| for (var i in group) { | |
| var name = group[i]; | |
| arr.push(namedMaterials[name]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment