topical media & game development

talk show tell print

mobile-query-three-plugins-terraingenerator-examples-index.htm / htm



  <!doctype html><title>Minimal tQuery Page</title>
  <script src="../../../build/tquery-bundle.js"></script>
  
  <script src="../../../vendor/three.js/ImprovedNoise.js"></script>
  <script src="../tquery.terraingenerator.js"></script>
  
  <body><script>
          var world        = tQuery.createWorld().boilerplate().start();
  
          var terrain        = tQuery.generateTerrainGeometry({
                  width        : 5,
                  height        : 5
          });
          var texture        = terrain.texture;        
          
          var geometry        = terrain.geometry;
  
          geometry.rotateX(35*Math.PI/180);
          //geometry.zoom(2);
          
          world.tRenderer().setClearColorHex( 0x82CAFA, 1 );
          
          var light        = new THREE.AmbientLight(0x444444);
          world.tScene().add(light);
          
          var light        = new THREE.DirectionalLight(0xFFFFFF, 3);
          light.position.set(0, 0.6, -1).normalize();
          world.tScene().add(light);
          
  
          var tMaterial        = new THREE.MeshPhongMaterial({
                  ambient        : 0x444444,
                  color        : 0xEE9A4D,
                  color        : 0x888888,
                  specular: 0xF86040,
                  shininess: 400,
                  color        : 0x3EA99F,
                  shading        : THREE.SmoothShading,
          });
          //var material        = new THREE.MeshNormalMaterial();
          var tMaterial        = new THREE.MeshBasicMaterial({ map : texture });
  
          mesh        = new THREE.Mesh(geometry.get(0), tMaterial);
          world.add(mesh);
  
  </script></body>
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.