Created
December 16, 2021 03:10
-
-
Save mitchallen/ff1c43260715cb583252e49d7625f332 to your computer and use it in GitHub Desktop.
ThreeJS cube example snippet
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
var cubeOptions = [ | |
{ color: "#FF0000" }, | |
{ color: "#00FF00", width: 0.5, height: 2, depth: 0.5 }, | |
{ color: "#0000FF", width: 2, height: 0.5, depth: 0.5 }, | |
{ color: "#FF00FF", width: 0.5, height: 0.5, depth: 2 }, | |
{ color: "#FFFF00", translateX: 3.0 }, | |
{ color: "#FF6619", translateX: -3.0 }, | |
{ color: "#AAAAAA", translateY: 2.0, translateZ: -0.05, width: 0.5, height: 0.5, depth: 2 }, | |
{ color: "#04D9FF", translateY: -2.0, translateZ: 0.05, width: 0.5, height: 0.5, depth: 2 }, | |
]; | |
cubeOptions.forEach(options => scene.add(CubeFactory.create(options))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment