/* SceneJS COLLADA import example - the Tank Program from the 1982 Disney motion picture "Tron". * * This demo is a revamp of the old one for V0.7.6, using new capabilities of V0.7.8: * * Take it for a drive - mouse wheel controls speed, left/right drag to steer, up/down drag to change viewpoint height. * * Tank model is courtesy of Abraham Katase, provided in the Google 3D Warehouse at http://tinyurl.com/y8oknya * * Lindsay S. Kay, * lindsay.kay@xeolabs.com */ SceneJS.createScene({ type: "scene", id: "theScene", canvasId: 'theCanvas', loggingElementId: "theLoggingDiv", nodes: [ /* Renderer node to set BG colour */ { type: "node", clearColor: { r: 0.3, g: 0.3, b: 0.6 }, clear: { depth : true, color : true }, nodes: [ /** * View transform - we've given it a globally-unique ID * so we can look it up and update it's properties from * mouse input. */ { type: "lookAt", id: "theLookAt", eye : { x: 0, y: 10, z: -400 }, look : { x: 0, y: 0, z: 0 }, up : { x: 0, y: 1, z: .0 }, nodes: [ { type: "camera", optics: { type: "perspective", fovy : 40.0, aspect : 1.47, near : 0.10, far : 7000.0 }, nodes: [ skySphereJSON, { type: "light", mode: "dir", color: { r: 1.0, g: 1.0, b: 0.5 }, diffuse: true, specular: true, dir: { x: 0.0, y: -1, z: -1.0 } }, { type:"light", mode: "dir", color: { r: 1.0, g: 1.0, b: 1.0 }, diffuse: true, specular: true, dir: { x: 1.0, y: -.5, z: -1.0 } }, { type: "light", mode: "dir", color: { r: 1.0, g: 1.0, b: 1.0 }, diffuse: true, specular: true, dir: { x: -1.0, y: -.5, z: 1.0 } }, /* Integrate our JSON Tron Tank model, which is defined in tron-tank-model.js * and loaded via a