topical media & game development

talk show tell print

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



  <!doctype html><title>Minimal tQuery Page</title>
  <script src="../../../build/tquery-bundle.js"></script>
  <script src="../tquery.skymap.js"></script>
  <script src="../tquery.cubetexture.js"></script>
  <body><script>
          var world        = tQuery.createWorld().boilerplate().start();
          var skymap        = tQuery.createSkymap('pisa').addTo(world);
  
          tQuery.createAmbientLight().addTo(world).color(0xFFFFFF);
          tQuery.createDirectionalLight().addTo(world).color(0xffffff).position(-1,1,1).intensity(1);
  
          //var envMap        = tQuery.createCubeTexture('pisa');
          //envMap                = new THREE.Texture( envMap.image, new THREE.CubeRefractionMapping() );
  
          var path        = "../../assets/images/textures/cube/SwedishRoyalCastle/";
          var format        = '.jpg';
          var urls        = [
                  path + 'px' + format, path + 'nx' + format,
                  path + 'py' + format, path + 'ny' + format,
                  path + 'pz' + format, path + 'nz' + format
          ];
  
          var reflectionCube        = THREE.ImageUtils.loadTextureCube( urls );
          reflectionCube.format        = THREE.RGBFormat;
  
          var refractionCube        = new THREE.Texture( reflectionCube.image, new THREE.CubeRefractionMapping() );
          refractionCube.format        = THREE.RGBFormat;
  
          
  
          tQuery.createTorusKnot().addTo(world)
                  .setBasicMaterial()
                          .envMap(tQuery.createCubeTexture('skybox'))
                          //.envMap(refractionCube)
                          .color(0xFFFFFF)
                          .ambient(0xffffff)
                          .refractionRatio(0.95)
                          .back();
  </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.