Browse Source

* Added 2 more examples to the README.
* Cleaned interactive_cubes example code.

Mr.doob 14 years ago
parent
commit
5053cc4e6d
2 changed files with 7 additions and 10 deletions
  1. 2 0
      README.md
  2. 5 10
      examples/interactive_cubes.html

+ 2 - 0
README.md

@@ -15,6 +15,8 @@ Other similar projects: [pre3d](http://deanm.github.com/pre3d/), [pvjs](http://c
 
 ### Examples ###
 
+[![interactive_cubes](http://mrdoob.github.com/three.js/assets/examples/11_interactive.png)](http://mrdoob.github.com/three.js/examples/interactive_cubes.html)
+[![camera_ortographic](http://mrdoob.github.com/three.js/assets/examples/10_orthographic.png)](http://mrdoob.github.com/three.js/examples/camera_orthographic.html)
 [![lights_pointlights](http://mrdoob.github.com/three.js/assets/examples/09_walthead.png)](http://mrdoob.github.com/three.js/examples/lights_pointlights.html)
 [![geometry_birds](http://mrdoob.github.com/three.js/assets/examples/08_birds.png)](http://mrdoob.github.com/three.js/examples/geometry_birds.html)
 [![geometry_earth](http://mrdoob.github.com/three.js/assets/examples/07_earth.png)](http://mrdoob.github.com/three.js/examples/geometry_earth.html)

+ 5 - 10
examples/interactive_cubes.html

@@ -24,15 +24,10 @@
 		<script type="text/javascript">
 
 			var container, stats;
-			var camera, scene, renderer;
-
-			var mouseX = 0, mouseY = 0, projector;
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
+			var camera, scene, projector, renderer;
 
 			init();
-			setInterval(loop, 1000/60);
+			setInterval( loop, 1000 / 60 );
 
 			function init() {
 
@@ -81,9 +76,9 @@
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
-				container.appendChild(stats.domElement);
+				container.appendChild( stats.domElement );
 
-				document.addEventListener('mousedown', onDocumentMouseDown, false);
+				document.addEventListener( 'mousedown', onDocumentMouseDown, false );
 
 			}
 
@@ -100,7 +95,7 @@
 
 				if ( intersects.length > 0 ) {
 
-					intersects.length && intersects[ 0 ].object.material[ 0 ].color.setHex( Math.random() * 0xffffff | 0x80000000 );
+					intersects[ 0 ].object.material[ 0 ].color.setHex( Math.random() * 0xffffff | 0x80000000 );
 
 					var particle = new THREE.Particle( new THREE.ParticleCircleMaterial( 0x000000 ) );
 					particle.position = intersects[ 0 ].point;