提交 6a857400 编写于 作者: M Mr.doob

REVISION ++

上级 76e7ea34
......@@ -139,6 +139,15 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
### Change Log ###
2011 04 09 - **r39** (249.048 KB, gzip: 61.020 KB)
* Improved WebGLRenderer program cache. ([alteredq](http://github.com/alteredq))
* Added support for pre-computed edges in loaders and exporters. ([alteredq](http://github.com/alteredq))
* Added `Sprite` object. ([empaempa](http://github.com/empaempa))
* Added `Collisions` classes. ([drojdjou](http://github.com/drojdjou))
* Added `THREE` namespace to all the classes that missed it. ([mrdoob](http://github.com/mrdoob))
2011 03 31 - **r38** (225.442 KB, gzip: 55.908 KB)
* Added `LensFlare` light. ([empaempa](http://github.com/empaempa))
......
// Three.js r38 - http://github.com/mrdoob/three.js
// Three.js r39 - http://github.com/mrdoob/three.js
var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(b){this.setHex(b)};
THREE.Color.prototype={autoUpdate:!0,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;this.hex=b.hex;this.__styleString=b.__styleString},setRGB:function(b,d,c){this.r=b;this.g=d;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(b,d,c){var f,g,h,j,k,m;if(c==0)f=g=h=0;else{j=Math.floor(b*6);k=b*6-j;b=c*(1-d);m=c*(1-d*k);d=c*(1-d*(1-k));switch(j){case 1:f=m;g=c;h=b;break;case 2:f=b;g=c;h=d;break;case 3:f=b;g=m;h=c;break;case 4:f=d;g=b;h=c;break;case 5:f=c;g=b;
h=m;break;case 6:case 0:f=c;g=d;h=b}}this.r=f;this.g=g;this.b=h;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(b){this.hex=~~b&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
......
// ThreeCanvas.js r38 - http://github.com/mrdoob/three.js
// ThreeCanvas.js r39 - http://github.com/mrdoob/three.js
var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=g=0;else{f=Math.floor(a*6);i=a*6-f;a=c*(1-b);h=c*(1-b*i);b=c*(1-b*(1-i));switch(f){case 1:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
......
// ThreeDOM.js r38 - http://github.com/mrdoob/three.js
// ThreeDOM.js r39 - http://github.com/mrdoob/three.js
var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=g=0;else{f=Math.floor(a*6);i=a*6-f;a=c*(1-b);h=c*(1-b*i);b=c*(1-b*(1-i));switch(f){case 1:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
......
// ThreeExtras.js r38 - http://github.com/mrdoob/three.js
// ThreeExtras.js r39 - http://github.com/mrdoob/three.js
var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,h=e.vertices,g=a.faces,j=e.faces,l=a.faceVertexUvs[0];e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var k=0,n=h.length;k<n;k++){var p=new THREE.Vertex(h[k].position.clone());c&&b.matrix.multiplyVector3(p.position);f.push(p)}k=0;for(n=j.length;k<n;k++){h=j[k];var t,w,x=h.vertexNormals;p=h.vertexColors;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+
d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+d,h.b+d,h.c+d,h.d+d));t.normal.copy(h.normal);c=0;for(f=x.length;c<f;c++){w=x[c];t.vertexNormals.push(w.clone())}t.color.copy(h.color);c=0;for(f=p.length;c<f;c++){w=p[c];t.vertexColors.push(w.clone())}t.materials=h.materials.slice();t.centroid.copy(h.centroid);g.push(t)}k=0;for(n=e.length;k<n;k++){d=e[k];g=[];c=0;for(f=d.length;c<f;c++)g.push(new THREE.UV(d[c].u,d[c].v));l.push(g)}}};
THREE.ImageUtils={loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b);b=e.loadCount=0;for(d=a.length;b<d;++b){e[b]=new Image;e[b].onload=function(){e.loadCount+=1;if(e.loadCount==6)f.needsUpdate=!0;c&&c(this)};e[b].src=a[b]}return f}};
......
// ThreeSVG.js r38 - http://github.com/mrdoob/three.js
// ThreeSVG.js r39 - http://github.com/mrdoob/three.js
var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=g=0;else{f=Math.floor(a*6);i=a*6-f;a=c*(1-b);h=c*(1-b*i);b=c*(1-b*(1-i));switch(f){case 1:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
......
// ThreeWebGL.js r38 - http://github.com/mrdoob/three.js
// ThreeWebGL.js r39 - http://github.com/mrdoob/three.js
var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(b){this.setHex(b)};
THREE.Color.prototype={autoUpdate:!0,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;this.hex=b.hex;this.__styleString=b.__styleString},setRGB:function(b,e,d){this.r=b;this.g=e;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(b,e,d){var h,g,k,i,p,q;if(d==0)h=g=k=0;else{i=Math.floor(b*6);p=b*6-i;b=d*(1-e);q=d*(1-e*p);e=d*(1-e*(1-p));switch(i){case 1:h=q;g=d;k=b;break;case 2:h=b;g=d;k=e;break;case 3:h=b;g=q;k=d;break;case 4:h=e;g=b;k=d;break;case 5:h=d;g=b;
k=q;break;case 6:case 0:h=d;g=e;k=b}}this.r=h;this.g=g;this.b=k;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(b){this.hex=~~b&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
......
......@@ -3,7 +3,7 @@
*/
THREE.Sprite = function( parameters ) {
THREE.Object3D.call( this );
if( parameters.material !== undefined ) {
......@@ -11,27 +11,27 @@ THREE.Sprite = function( parameters ) {
this.material = parameters.material;
this.map = undefined;
this.blending = material.blending;
} else if( parameters.map !== undefined ) {
this.map = parameters.map instanceof THREE.Texture ? parameters.map : ImageUtils.loadTexture( parameters.map );
this.material = undefined;
this.blending = parameters.blending !== undefined ? parameters.blending : THREE.NormalBlending;
}
this.useScreenCoordinates = parameters.useScreenCoordinates !== undefined ? parameters.useScreenCoordinates : true;
this.mergeWith3D = parameters.mergeWith3D !== undefined ? parameters.mergeWith3D : !this.useScreenCoordinates;
this.affectedByDistance = parameters.affectedByDistance !== undefined ? parameters.affectedByDistance : !this.useScreenCoordinates;
this.alignment = parameters.alignment instanceof THREE.Vector2 ? parameters.alignment : THREE.SpriteAlignment.center;
this.rotation3d = this.rotation;
this.rotation = 0;
this.opacity = 1;
this.uvOffset = new THREE.Vector2( 0, 0 );
this.uvScale = new THREE.Vector2( 1, 1 );
};
THREE.Sprite.prototype = new THREE.Object3D();
......@@ -75,5 +75,3 @@ THREE.SpriteAlignment.centerRight = new THREE.Vector2( -1, 0 );
THREE.SpriteAlignment.bottomLeft = new THREE.Vector2( 1, 1 );
THREE.SpriteAlignment.bottomCenter = new THREE.Vector2( 0, 1 );
THREE.SpriteAlignment.bottomRight = new THREE.Vector2( -1, 1 );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册