summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Becker <jeff@i2p.rocks>2019-07-07 10:21:33 -0400
committerJeff Becker <jeff@i2p.rocks>2019-07-07 10:21:33 -0400
commit12940b09abdd10dc0cdf6e5f7aa3a8abffe23553 (patch)
treee91f867e9064d0bf940e956f6fa7925af2b17124
parentca88a53829eefc585874dd22070e27b9ce61baf7 (diff)
try adding skybox
-rw-r--r--docroot/main.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/docroot/main.js b/docroot/main.js
index 16371d3..301ba11 100644
--- a/docroot/main.js
+++ b/docroot/main.js
@@ -36,7 +36,22 @@ loader.load("img/alexjones.jpeg", function(tex) {
cube = new THREE.Mesh( geometry, material );
scene.add(cube);
});
-
+ //skybox
+ var skyboxside = THREE.ImageUtils.loadTexture( "img/ebin.jpeg" );
+ var materialArray = [];
+ for (var i = 0; i < 6; i++)
+ {
+ materialArray.push( new THREE.MeshBasicMaterial({
+ map: skyboxside,
+ side: THREE.BackSide
+ }));
+ }
+
+ var skyGeometry = new THREE.CubeGeometry( 500, 500, 500 );
+ var skyMaterial = new THREE.MeshFaceMaterial( materialArray );
+ var skyBox = new THREE.Mesh( skyGeometry, skyMaterial );
+ skyBox.rotation.x += Math.PI / 2;
+ scene.add( skyBox );
}
var composer ;