瀏覽代碼

- Added TODO
- Minor tweaks

Mr.doob 15 年之前
父節點
當前提交
5ce7a10bbb
共有 11 個文件被更改,包括 102 次插入61 次删除
  1. 2 1
      README.md
  2. 16 0
      TODO
  3. 0 0
      build/Three.js
  4. 0 0
      build/ThreeDebug.js
  5. 3 9
      src/core/Color.js
  6. 7 3
      src/core/Face3.js
  7. 7 3
      src/core/Face4.js
  8. 12 2
      src/core/Geometry.js
  9. 43 39
      src/core/Matrix4.js
  10. 6 2
      src/core/Vertex.js
  11. 6 2
      src/materials/LineColorMaterial.js

+ 2 - 1
README.md

@@ -136,10 +136,11 @@ Thanks to the power of the internets (and github <3) these people have kindly he
 
 
 ### Change Log ###
 ### Change Log ###
 
 
-2010 09 17 - **r17** (39.005 kb)
+2010 09 17 - **r17** (39.487 kb)
 
 
 * Added `Light`, `AmbientLight` and `DirectionalLight` ([philogb](http://github.com/philogb))
 * Added `Light`, `AmbientLight` and `DirectionalLight` ([philogb](http://github.com/philogb))
 * `WebGLRenderer` basic lighting support ([philogb](http://github.com/philogb))
 * `WebGLRenderer` basic lighting support ([philogb](http://github.com/philogb))
+* Memory optimisations
 
 
 
 
 2010 08 21 - **r16** (35.592 kb)
 2010 08 21 - **r16** (35.592 kb)

+ 16 - 0
TODO

@@ -0,0 +1,16 @@
+- Core
+	- Simple hierarchy system (look at D1plo1d and tamask branches)
+	- Interaction, 2D to 3D projection.
+- Examples
+	- DOMRenderer example
+- Materials
+	- MeshBitmapSphereMappingMaterial. http://en.wikipedia.org/wiki/Sphere_mapping
+	- MeshBitmapCubeMappingMaterial. http://en.wikipedia.org/wiki/Cube_mapping
+	- MeshShaderMaterial for WebGLRenderer
+	- Add MeshBitmapUVMappingMaterial to WebGLRenderer
+- Renderers
+	- Add Lights to Renderer (CanvasRenderer and SVGRenderer)
+	- FrustrumClipping near to Renderer (CanvasRenderer and SVGRenderer)
+- Utils
+	- Blender 2.5b4 plugin system has change considerably :/
+

文件差異過大導致無法顯示
+ 0 - 0
build/Three.js


文件差異過大導致無法顯示
+ 0 - 0
build/ThreeDebug.js


+ 3 - 9
src/core/Color.js

@@ -4,19 +4,13 @@
 
 
 THREE.Color = function ( hex ) {
 THREE.Color = function ( hex ) {
 
 
-	/*
-	this.r; this.g; this.b; this.a;
-	this.hex;
-	this.__styleString = 'rgba(0, 0, 0, 1)';
-	*/
-  
-  this.setHex( hex );
-  
+	this.setHex( hex );
+
 }
 }
 
 
 THREE.Color.prototype = {
 THREE.Color.prototype = {
 
 
-  setHex: function ( hex ) {
+	setHex: function ( hex ) {
 
 
 		this.hex = hex;
 		this.hex = hex;
 		this.updateRGBA();
 		this.updateRGBA();

+ 7 - 3
src/core/Face3.js

@@ -13,10 +13,14 @@ THREE.Face3 = function ( a, b, c, normal, color ) {
 
 
 	this.color = color || new THREE.Color( 0x000000 );
 	this.color = color || new THREE.Color( 0x000000 );
 
 
-	this.toString = function () {
+};
+
+THREE.Face3.prototype = {
+
+	toString: function () {
 
 
 		return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
 		return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
 
 
-	};
+	}
 
 
-};
+}

+ 7 - 3
src/core/Face4.js

@@ -14,10 +14,14 @@ THREE.Face4 = function ( a, b, c, d, normal, color ) {
 
 
 	this.color = color || new THREE.Color( 0x000000 );
 	this.color = color || new THREE.Color( 0x000000 );
 
 
-	this.toString = function () {
+};
+
+THREE.Face4.prototype = {
+
+	toString: function () {
 
 
 		return 'THREE.Face4 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' ' + this.d + ' )';
 		return 'THREE.Face4 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' ' + this.d + ' )';
 
 
-	};
+	}
 
 
-};
+}

+ 12 - 2
src/core/Geometry.js

@@ -9,7 +9,11 @@ THREE.Geometry = function () {
 	this.faces = [];
 	this.faces = [];
 	this.uvs = [];
 	this.uvs = [];
 
 
-	this.computeNormals = function () {
+};
+
+THREE.Geometry.prototype = {
+
+	computeNormals: function () {
 
 
 		var v, f, vA, vB, vC, cb, ab;
 		var v, f, vA, vB, vC, cb, ab;
 
 
@@ -42,6 +46,12 @@ THREE.Geometry = function () {
 
 
 		}
 		}
 
 
-	};
+	},
+
+	toString: function () {
+
+		return 'THREE.Geometry ( vertices: ' + this.vertices + ', faces: ' + this.faces + ' )';
+
+	}
 
 
 };
 };

+ 43 - 39
src/core/Matrix4.js

@@ -185,24 +185,28 @@ THREE.Matrix4.prototype = {
 			this.n11 * this.n22 * this.n33 * this.n44 );
 			this.n11 * this.n22 * this.n33 * this.n44 );
 
 
 	},
 	},
-	
-  transpose: function () {
-    function swap(obj, p1, p2) {
-      var aux = obj[p1];
-      obj[p1] = obj[p2];
-      obj[p2] = aux;
-    }
-    
-    swap(this, 'n21', 'n12');
-    swap(this, 'n31', 'n13');
-    swap(this, 'n32', 'n23');
-    swap(this, 'n41', 'n14');
-    swap(this, 'n42', 'n24');
-    swap(this, 'n43', 'n34');
-    return this;
-    
-  },
-  
+
+	transpose: function () {
+
+		function swap( obj, p1, p2 ) {
+
+			var aux = obj[ p1 ];
+			obj[ p1 ] = obj[ p2 ];
+			obj[ p2 ] = aux;
+
+		}
+
+		swap( this, 'n21', 'n12' );
+		swap( this, 'n31', 'n13' );
+		swap( this, 'n32', 'n23' );
+		swap( this, 'n41', 'n14' );
+		swap( this, 'n42', 'n24' );
+		swap( this, 'n43', 'n34' );
+
+		return this;
+
+	},
+
 	clone: function () {
 	clone: function () {
 
 
 		var m = new THREE.Matrix4();
 		var m = new THREE.Matrix4();
@@ -213,14 +217,14 @@ THREE.Matrix4.prototype = {
 		return m;
 		return m;
 
 
 	},
 	},
-	
+
 	flatten: function() {
 	flatten: function() {
 
 
 	  return [this.n11, this.n21, this.n31, this.n41,
 	  return [this.n11, this.n21, this.n31, this.n41,
 	      this.n12, this.n22, this.n32, this.n42,
 	      this.n12, this.n22, this.n32, this.n42,
 	      this.n13, this.n23, this.n33, this.n43,
 	      this.n13, this.n23, this.n33, this.n43,
 	      this.n14, this.n24, this.n34, this.n44];
 	      this.n14, this.n24, this.n34, this.n44];
-	 
+
 	},
 	},
 
 
 	toString: function() {
 	toString: function() {
@@ -296,25 +300,25 @@ THREE.Matrix4.rotationZMatrix = function ( theta ) {
 
 
 THREE.Matrix4.rotationAxisAngleMatrix = function ( axis, angle ) {
 THREE.Matrix4.rotationAxisAngleMatrix = function ( axis, angle ) {
 
 
-  //Based on http://www.gamedev.net/reference/articles/article1199.asp
-  
-  var rot = new THREE.Matrix4();
-  var c = Math.cos( angle );
-  var s = Math.sin( angle );
-  var t = 1 - c;
-  var x = axis.x, y = axis.y, z = axis.z;
-
-  rot.n11 = t * x * x + c;
-  rot.n12 = t * x * y - s * z;
-  rot.n13 = t * x * z + s * y;
-  rot.n21 = t * x * y + s * z;
-  rot.n22 = t * y * y + c;
-  rot.n23 = t * y * z - s * x;
-  rot.n31 = t * x * z - s * y;
-  rot.n32 = t * y * z + s * x;
-  rot.n33 = t * z * z + c;
-
-  return rot;
+	//Based on http://www.gamedev.net/reference/articles/article1199.asp
+
+	var rot = new THREE.Matrix4(),
+	c = Math.cos( angle ),
+	s = Math.sin( angle ),
+	t = 1 - c,
+	x = axis.x, y = axis.y, z = axis.z;
+
+	rot.n11 = t * x * x + c;
+	rot.n12 = t * x * y - s * z;
+	rot.n13 = t * x * z + s * y;
+	rot.n21 = t * x * y + s * z;
+	rot.n22 = t * y * y + c;
+	rot.n23 = t * y * z - s * x;
+	rot.n31 = t * x * z - s * y;
+	rot.n32 = t * y * z + s * x;
+	rot.n33 = t * z * z + c;
+
+	return rot;
 
 
 };
 };
 
 

+ 6 - 2
src/core/Vertex.js

@@ -10,8 +10,12 @@ THREE.Vertex = function ( position, normal ) {
 
 
 	this.__visible = true;
 	this.__visible = true;
 
 
-	this.toString = function () {
+}
+
+THREE.Vertex.prototype = {
+
+	toString: function () {
 
 
 		return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )';
 		return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )';
-	};
+	}
 };
 };

+ 6 - 2
src/materials/LineColorMaterial.js

@@ -8,10 +8,14 @@ THREE.LineColorMaterial = function ( hex, opacity, lineWidth ) {
 
 
 	this.color = new THREE.Color( ( opacity >= 0 ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
 	this.color = new THREE.Color( ( opacity >= 0 ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
 
 
-	this.toString = function () {
+};
+
+THREE.LineColorMaterial.prototype = {
+
+	toString: function () {
 
 
 		return 'THREE.LineColorMaterial ( color: ' + this.color + ', lineWidth: ' + this.lineWidth + ' )';
 		return 'THREE.LineColorMaterial ( color: ' + this.color + ', lineWidth: ' + this.lineWidth + ' )';
 
 
-	};
+	}
 
 
 };
 };

部分文件因文件數量過多而無法顯示