Browse Source

- Removed unneded updateMatrix in Camera
- Simplified lookAt in Matrix4
- Added cross() in Vector3

Mr.doob 15 years ago
parent
commit
74e70f1358
5 changed files with 15 additions and 9 deletions
  1. 5 3
      README.md
  2. 0 0
      build/three.js
  3. 0 2
      src/cameras/Camera.js
  4. 2 4
      src/core/Matrix4.js
  5. 8 0
      src/core/Vector3.js

+ 5 - 3
README.md

@@ -5,7 +5,9 @@ three.js
 
 [![Flattr this](http://api.flattr.com/button/button-compact-static-100x17.png)](http://flattr.com/thing/287/three-js)
 
-This project is work in progress. Before using it in a project be aware that the syntax may change from revision to revision without being backwards compatible. Currently there is no documentation, feel free to use the demos as a reference and/or read the source code. The engine can render using <canvas> and <svg> so far. WebGL renderer coming soon.
+The aim of this project is to create a 3D engine with a very low level of abstraction (aka for dummies). Currently there is no documentation available but feel free to use the examples as a reference and/or read the source code. However, be aware that the syntax may change from revision to revision breaking compatibility.
+
+The engine can render using <canvas> and <svg> by now and WebGL renderer will be available soon.
 
 [More info...](http://mrdoob.com/blog/post/693)
 
@@ -75,7 +77,7 @@ This code creates a camera, then creates a scene object, adds a bunch of random
 
 	</script>
 
-If you are interested on messing with the actual library, instead of importing the three.js compressed file, you can include the original files in this order:
+For creating a customised version of the library, including the source files in this order would be a good way to start:
 
 	<script type="text/javascript" src="js/three/Three.js"></script>
 	<script type="text/javascript" src="js/three/core/Color.js"></script>
@@ -110,7 +112,7 @@ If you are interested on messing with the actual library, instead of importing t
 
 ### Change Log ###
 
-2010 06 22 - **r10** (23.908 kb)
+2010 06 22 - **r10** (23.959 kb)
 
 * Changed Camera system. (Thx [Paul Brunt](http://github.com/supereggbert))
 * Object3D.overdraw = true to enable CanvasRenderer screen space point expansion hack.

File diff suppressed because it is too large
+ 0 - 0
build/three.js


+ 0 - 2
src/cameras/Camera.js

@@ -19,8 +19,6 @@ THREE.Camera = function ( fov, aspect, near, far ) {
 
 	};
 
-	this.updateMatrix();
-
 	this.toString = function () {
 
 		return 'THREE.Camera ( ' + this.position + ', ' + this.target.position + ' )';

+ 2 - 4
src/core/Matrix4.js

@@ -29,12 +29,10 @@ THREE.Matrix4 = function () {
 		z.sub( eye, center );
 		z.normalize();
 
-		x.copy( up );
-		x.crossSelf( z );
+		x.cross( up, z );
 		x.normalize();
 
-		y.copy( z );
-		y.crossSelf( x );
+		y.cross( z, x );
 		y.normalize();
 		y.negate();
 

+ 8 - 0
src/core/Vector3.js

@@ -65,6 +65,14 @@ THREE.Vector3 = function ( x, y, z ) {
 
 	};
 
+	this.cross = function ( v1, v2 ) {
+
+		this.x = v1.y * v2.z - v1.z * v2.y;
+		this.y = v1.z * v2.x - v1.x * v2.z;
+		this.z = v1.x * v2.y - v1.y * v2.x;
+
+	};
+
 	this.crossSelf = function ( v ) {
 
 		var tx = this.x, ty = this.y, tz = this.z;

Some files were not shown because too many files changed in this diff