var scene, cam, controls var environment = (function(){ var environment = {} var grids environment.init = function(){ environment.ready() } environment.ready = function(){ scene = new MX.Scene().addTo('#scene') cam = scene.camera controls = new MX.FollowingOrbitCamera({ center: { x: -100, y: 0, z: 0 }, radius: 700, radiusRange: [ 10, 2000 ], rotationXRange: [ 0.428 * Math.PI, 0.455 * Math.PI ], rotationYRange: [ 0.083 * Math.PI, 0.100 * Math.PI ], rotationX: Math.PI * 0.45, rotationY: Math.PI * 0.125, wheelEase: 20, ease: 10 }) controls.init() controls.wheel.lock() var grid_opts = { width: 500, height: 500, side: 23, strokeWidth: 2, bg: "#000000", stroke: "#0088ff", duration: 1000, delay: [ 0, 500 ], } grids = [ new Grid ( defaults({ halign: "right", valign: "bottom" }, grid_opts) ), new Grid ( defaults({ halign: "right", valign: "bottom" }, grid_opts) ), new Grid ( defaults({ halign: "right", valign: "top" }, grid_opts) ), ] var m = new MX.Object3D( grids[0].snap.node ) m.z = 250 m.y = 250 m.width = m.height = 500 m.rotationY = -Math.PI/2 scene.add(m) var m = new MX.Object3D( grids[1].snap.node ) m.x = 250 m.y = 250 m.width = m.height = 500 m.rotationY = Math.PI scene.add(m) var m = new MX.Object3D( grids[2].snap.node ) m.x = 250 m.z = 250 m.width = m.height = 500 m.rotationX = Math.PI/2 scene.add(m) var dog = new Image () dog.classList.add("dog") dog.src = "img/lab_sitting.png" var m = new MX.Object3D( dog ) m.x = 250 m.y = 39 m.z = 250 m.rotationY = Math.PI/2 m.scale = 0.2 scene.add(m) var logo = Snap(480 * 2, 74 * 2) logo.attr({ 'viewBox': '0 0 480 74.1' }) logo.node.classList.add("logo") var m = new MX.Object3D( logo.node ) m.x = 220 m.y = 148 m.z = 5 m.scale = 0.6 / 2 m.rotationY = Math.PI scene.add(m) var tagline = new MX.Object3D () tagline.el.innerHTML = '