提交 5ce7a10b 编写于 作者: M Mr.doob

- Added TODO

- Minor tweaks
上级 c88fa50a
......@@ -136,10 +136,11 @@ Thanks to the power of the internets (and github <3) these people have kindly he
### 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))
* `WebGLRenderer` basic lighting support ([philogb](http://github.com/philogb))
* Memory optimisations
2010 08 21 - **r16** (35.592 kb)
......
- 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 :/
此差异已折叠。
此差异已折叠。
......@@ -4,19 +4,13 @@
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 = {
setHex: function ( hex ) {
setHex: function ( hex ) {
this.hex = hex;
this.updateRGBA();
......
......@@ -13,10 +13,14 @@ THREE.Face3 = function ( a, b, c, normal, color ) {
this.color = color || new THREE.Color( 0x000000 );
this.toString = function () {
};
THREE.Face3.prototype = {
toString: function () {
return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
};
}
};
}
......@@ -14,10 +14,14 @@ THREE.Face4 = function ( a, b, c, d, normal, color ) {
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 + ' )';
};
}
};
}
......@@ -9,7 +9,11 @@ THREE.Geometry = function () {
this.faces = [];
this.uvs = [];
this.computeNormals = function () {
};
THREE.Geometry.prototype = {
computeNormals: function () {
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 + ' )';
}
};
......@@ -185,24 +185,28 @@ THREE.Matrix4.prototype = {
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 () {
var m = new THREE.Matrix4();
......@@ -213,14 +217,14 @@ THREE.Matrix4.prototype = {
return m;
},
flatten: function() {
return [this.n11, this.n21, this.n31, this.n41,
this.n12, this.n22, this.n32, this.n42,
this.n13, this.n23, this.n33, this.n43,
this.n14, this.n24, this.n34, this.n44];
},
toString: function() {
......@@ -296,25 +300,25 @@ THREE.Matrix4.rotationZMatrix = function ( theta ) {
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;
};
......
......@@ -10,8 +10,12 @@ THREE.Vertex = function ( position, normal ) {
this.__visible = true;
this.toString = function () {
}
THREE.Vertex.prototype = {
toString: function () {
return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )';
};
}
};
......@@ -8,10 +8,14 @@ THREE.LineColorMaterial = function ( hex, opacity, lineWidth ) {
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 + ' )';
};
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册