diff options
Diffstat (limited to 'assets/javascripts/environment.js')
| -rw-r--r-- | assets/javascripts/environment.js | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/assets/javascripts/environment.js b/assets/javascripts/environment.js new file mode 100644 index 0000000..513deea --- /dev/null +++ b/assets/javascripts/environment.js @@ -0,0 +1,99 @@ +var environment = new function(){} +environment.init = function () { + + cam.rotationY = -3.77 + //controls.init(cam, scene) + + cam.z = -200 + cam.x = 400 + + var borderColor = '#000' + + // set up objects + center = {} + center.z = 900 + + doorWidth = 300 + doorHeight = 450 + doorOffset = 0 + wallColor = 'rgba(255,255,255,0.85)' + + box = new MX.BoxDimensions({ + width: 2000, + height: 900, + depth: 2000, + color: wallColor, + borderColor: borderColor, + sides: "top bottom left right back", + tag: "bigroom" + }) + box.z = 500 - center.z + scene.add(box) + + box = new MX.BoxDimensions({ + width: 1000, + height: 900, + depth: 1000, + color: wallColor, + borderColor: borderColor, + sides: "top bottom left right front", + tag: "smallroom" + }) + box.z = -500 - 200 - 500 - center.z + scene.add(box) + + hall = new MX.BoxDimensions({ + width: doorWidth, + height: doorHeight, + depth: 200, + color: wallColor, + borderColor: borderColor, + sides: "top bottom left right", + tag: "hall" + }) + hall.z = -600- center.z + scene.add(hall) + + door = new MX.Door({ + width: 2000, + height: 900, + doorWidth: doorWidth, + doorHeight: doorHeight, + doorOffset: doorOffset, + color: wallColor, + borderColor: borderColor + }) + door.z = -500 - center.z + scene.add(door) + + door = new MX.Door({ + width: 1000, + height: 900, + doorWidth: doorWidth, + doorHeight: doorHeight, + doorOffset: doorOffset, + color: wallColor, + borderColor: borderColor + }) + door.z = -700 - center.z + scene.add(door) + + var image = environment.image = new MX.Image({ + src: "https://s3.amazonaws.com/luckyplop/f5b2c20e602cdfc86383910f294dcf23d91fa956.png", + x: -990, + y: 450, + z: 0 - center.z, + }) + image.rotationY = MX.toRad(90) + scene.add(image) + + var video = environment.video = new MX.Video({ + src: "//www.dotdash3.com/video/svvnDp9_Q1s.mp4", + x: 0, + y: 300, + z: -500 - 200 - 500 - 450 - center.z, + }) + video.rotationY = MX.toRad(180) + scene.add(video) + +} |
