Permalink
Browse files

example of dynamic cubemap

  • Loading branch information...
1 parent 077e5a0 commit 8b8f1c1950805edd1af4aade810ecb6d4be05cc9 @jeromeetienne committed Feb 27, 2013
@@ -0,0 +1,35 @@
+<!doctype html><title>Minimal tQuery Page</title>
+<script src="../../../build/tquery-bundle-require.js"></script>
+<body><script>
+ var world = tQuery.createWorld().boilerplate().start();
+
+ tQuery.createSphere().addTo(world)
+ .scale(1000)
+ .setBasicMaterial()
+ .map('images/2294472375_24a3b8ef46_o.jpg')
+ .side(THREE.BackSide)
+ .back()
+
+ var cubeCamera = new THREE.CubeCamera( 0.001, 1000, 256 );
+ // to avoid flickering on the border of the sphere
+ cubeCamera.renderTarget.minFilter = THREE.LinearMipMapLinearFilter;
+
+ var tMaterial = new THREE.MeshBasicMaterial({
+ envMap : cubeCamera.renderTarget
+ });
+
+ var sphere = tQuery.createSphere(tMaterial).addTo(world)
+
+ tQuery(cubeCamera).addTo(sphere)
+
+ tQuery.createSphere().addTo(world)
+ .positionX( 1)
+
+ world.loop().hook(function(){
+ sphere.visible(false) // *cough*
+
+ cubeCamera.updateCubeMap( world.tRenderer(), world.tScene() );
+
+ sphere.visible(true) // *cough*
+ })
+</script></body>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8b8f1c1

Please sign in to comment.