Skip to content

Commit 5ce7a10

Browse files
committed
- Added TODO
- Minor tweaks
1 parent c88fa50 commit 5ce7a10

File tree

11 files changed

+104
-63
lines changed

11 files changed

+104
-63
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ Thanks to the power of the internets (and github <3) these people have kindly he
136136

137137
### Change Log ###
138138

139-
2010 09 17 - **r17** (39.005 kb)
139+
2010 09 17 - **r17** (39.487 kb)
140140

141141
* Added `Light`, `AmbientLight` and `DirectionalLight` ([philogb](http://github.com/philogb))
142142
* `WebGLRenderer` basic lighting support ([philogb](http://github.com/philogb))
143+
* Memory optimisations
143144

144145

145146
2010 08 21 - **r16** (35.592 kb)

TODO

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- Core
2+
- Simple hierarchy system (look at D1plo1d and tamask branches)
3+
- Interaction, 2D to 3D projection.
4+
- Examples
5+
- DOMRenderer example
6+
- Materials
7+
- MeshBitmapSphereMappingMaterial. http://en.wikipedia.org/wiki/Sphere_mapping
8+
- MeshBitmapCubeMappingMaterial. http://en.wikipedia.org/wiki/Cube_mapping
9+
- MeshShaderMaterial for WebGLRenderer
10+
- Add MeshBitmapUVMappingMaterial to WebGLRenderer
11+
- Renderers
12+
- Add Lights to Renderer (CanvasRenderer and SVGRenderer)
13+
- FrustrumClipping near to Renderer (CanvasRenderer and SVGRenderer)
14+
- Utils
15+
- Blender 2.5b4 plugin system has change considerably :/
16+

build/Three.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ThreeDebug.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/Color.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@
44

55
THREE.Color = function ( hex ) {
66

7-
/*
8-
this.r; this.g; this.b; this.a;
9-
this.hex;
10-
this.__styleString = 'rgba(0, 0, 0, 1)';
11-
*/
12-
13-
this.setHex( hex );
14-
7+
this.setHex( hex );
8+
159
}
1610

1711
THREE.Color.prototype = {
1812

19-
setHex: function ( hex ) {
13+
setHex: function ( hex ) {
2014

2115
this.hex = hex;
2216
this.updateRGBA();

src/core/Face3.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ THREE.Face3 = function ( a, b, c, normal, color ) {
1313

1414
this.color = color || new THREE.Color( 0x000000 );
1515

16-
this.toString = function () {
16+
};
17+
18+
THREE.Face3.prototype = {
19+
20+
toString: function () {
1721

1822
return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
1923

20-
};
24+
}
2125

22-
};
26+
}

src/core/Face4.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ THREE.Face4 = function ( a, b, c, d, normal, color ) {
1414

1515
this.color = color || new THREE.Color( 0x000000 );
1616

17-
this.toString = function () {
17+
};
18+
19+
THREE.Face4.prototype = {
20+
21+
toString: function () {
1822

1923
return 'THREE.Face4 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' ' + this.d + ' )';
2024

21-
};
25+
}
2226

23-
};
27+
}

src/core/Geometry.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ THREE.Geometry = function () {
99
this.faces = [];
1010
this.uvs = [];
1111

12-
this.computeNormals = function () {
12+
};
13+
14+
THREE.Geometry.prototype = {
15+
16+
computeNormals: function () {
1317

1418
var v, f, vA, vB, vC, cb, ab;
1519

@@ -42,6 +46,12 @@ THREE.Geometry = function () {
4246

4347
}
4448

45-
};
49+
},
50+
51+
toString: function () {
52+
53+
return 'THREE.Geometry ( vertices: ' + this.vertices + ', faces: ' + this.faces + ' )';
54+
55+
}
4656

4757
};

src/core/Matrix4.js

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,28 @@ THREE.Matrix4.prototype = {
185185
this.n11 * this.n22 * this.n33 * this.n44 );
186186

187187
},
188-
189-
transpose: function () {
190-
function swap(obj, p1, p2) {
191-
var aux = obj[p1];
192-
obj[p1] = obj[p2];
193-
obj[p2] = aux;
194-
}
195-
196-
swap(this, 'n21', 'n12');
197-
swap(this, 'n31', 'n13');
198-
swap(this, 'n32', 'n23');
199-
swap(this, 'n41', 'n14');
200-
swap(this, 'n42', 'n24');
201-
swap(this, 'n43', 'n34');
202-
return this;
203-
204-
},
205-
188+
189+
transpose: function () {
190+
191+
function swap( obj, p1, p2 ) {
192+
193+
var aux = obj[ p1 ];
194+
obj[ p1 ] = obj[ p2 ];
195+
obj[ p2 ] = aux;
196+
197+
}
198+
199+
swap( this, 'n21', 'n12' );
200+
swap( this, 'n31', 'n13' );
201+
swap( this, 'n32', 'n23' );
202+
swap( this, 'n41', 'n14' );
203+
swap( this, 'n42', 'n24' );
204+
swap( this, 'n43', 'n34' );
205+
206+
return this;
207+
208+
},
209+
206210
clone: function () {
207211

208212
var m = new THREE.Matrix4();
@@ -213,14 +217,14 @@ THREE.Matrix4.prototype = {
213217
return m;
214218

215219
},
216-
220+
217221
flatten: function() {
218222

219223
return [this.n11, this.n21, this.n31, this.n41,
220224
this.n12, this.n22, this.n32, this.n42,
221225
this.n13, this.n23, this.n33, this.n43,
222226
this.n14, this.n24, this.n34, this.n44];
223-
227+
224228
},
225229

226230
toString: function() {
@@ -296,25 +300,25 @@ THREE.Matrix4.rotationZMatrix = function ( theta ) {
296300

297301
THREE.Matrix4.rotationAxisAngleMatrix = function ( axis, angle ) {
298302

299-
//Based on http://www.gamedev.net/reference/articles/article1199.asp
300-
301-
var rot = new THREE.Matrix4();
302-
var c = Math.cos( angle );
303-
var s = Math.sin( angle );
304-
var t = 1 - c;
305-
var x = axis.x, y = axis.y, z = axis.z;
306-
307-
rot.n11 = t * x * x + c;
308-
rot.n12 = t * x * y - s * z;
309-
rot.n13 = t * x * z + s * y;
310-
rot.n21 = t * x * y + s * z;
311-
rot.n22 = t * y * y + c;
312-
rot.n23 = t * y * z - s * x;
313-
rot.n31 = t * x * z - s * y;
314-
rot.n32 = t * y * z + s * x;
315-
rot.n33 = t * z * z + c;
316-
317-
return rot;
303+
//Based on http://www.gamedev.net/reference/articles/article1199.asp
304+
305+
var rot = new THREE.Matrix4(),
306+
c = Math.cos( angle ),
307+
s = Math.sin( angle ),
308+
t = 1 - c,
309+
x = axis.x, y = axis.y, z = axis.z;
310+
311+
rot.n11 = t * x * x + c;
312+
rot.n12 = t * x * y - s * z;
313+
rot.n13 = t * x * z + s * y;
314+
rot.n21 = t * x * y + s * z;
315+
rot.n22 = t * y * y + c;
316+
rot.n23 = t * y * z - s * x;
317+
rot.n31 = t * x * z - s * y;
318+
rot.n32 = t * y * z + s * x;
319+
rot.n33 = t * z * z + c;
320+
321+
return rot;
318322

319323
};
320324

src/core/Vertex.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ THREE.Vertex = function ( position, normal ) {
1010

1111
this.__visible = true;
1212

13-
this.toString = function () {
13+
}
14+
15+
THREE.Vertex.prototype = {
16+
17+
toString: function () {
1418

1519
return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )';
16-
};
20+
}
1721
};

0 commit comments

Comments
 (0)