document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. $(function(){
  2.     var camera, scene, renderer,
  3.     geometry, material, mesh, stats;
  4.  
  5.     var w = 520;
  6.     var h = 390;
  7.  
  8.     function init() {
  9.  
  10.         camera = new THREE.Camera( 75, w / h, 1, 10000 );
  11.         camera.position.z = 1000;
  12.  
  13.         scene = new THREE.Scene();
  14.  
  15.         geometry = new THREE.Cube( 200, 200, 200 );
  16.         material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
  17.  
  18.         mesh = new THREE.Mesh( geometry, material );
  19.         scene.addObject( mesh );
  20.  
  21.         renderer = new THREE.CanvasRenderer();
  22.         renderer.setSize( w, h );
  23.  
  24.         $(\'#three-stage\').append( renderer.domElement );
  25.  
  26.         //Stats SetUp
  27.         stats = new Stats();
  28.         stats.domElement.style.position = \'absolute\';
  29.         stats.domElement.style.top = \'0px\';
  30.         stats.domElement.style.zIndex = 100;
  31.         $(\'#three-stage\').append( stats.domElement );
  32.  
  33.     }
  34.  
  35.     function animate() {
  36.  
  37.         // Include examples/js/RequestAnimationFrame.js for cross-browser compatibility.
  38.         requestAnimationFrame( animate );
  39.         render();
  40.  
  41.     }
  42.  
  43.     function render() {
  44.  
  45.         mesh.rotation.x += 0.01;
  46.         mesh.rotation.y += 0.02;
  47.  
  48.         renderer.render( scene, camera );
  49.  
  50.         //Stats update
  51.         stats.update();
  52.     }
  53.  
  54.     init();
  55.     animate();
  56. });
');