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

r56

上级 9d688e40
......@@ -65,6 +65,34 @@ This code creates a scene, then creates a camera, adds the camera and cube to th
### Change log ###
2013 02 15 - **r56** (407,609 KB, gzip: 96,870 KB)
* Added `LineDashedMaterial` support to `CanvasRenderer`. ([sole](http://github.com/sole))
* Documentation improvements. ([gero3](http://github.com/gero3), [erich666](http://github.com/erich666), [Stompfrog](http://github.com/Stompfrog), [morenoh149](http://github.com/morenoh149), [chrmoritz](http://github.com/chrmoritz) and [mrdoob](http://github.com/mrdoob))
* Added `Matrix3.getNormalMatrix()` and `Vector3.transformDirection()`. ([WestLangley](http://github.com/WestLangley))
* Added [generator](https://github.com/mrdoob/three.js/blob/master/utils/sublime.py) for [Sublime Text 2 completion file](https://github.com/mrdoob/three.js/tree/master/utils/editors/sublimetext2). ([mrdoob](http://github.com/mrdoob))
* Removed `Matrix4`'s `getPosition()` and `getColumn*()`. ([mrdoob](http://github.com/mrdoob) and [bhouston](http://github.com/bhouston))
* [Blender exporter](https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender) improvements. ([migvel](http://github.com/migvel))
* Added `Vector*.toArray()`. ([mrdoob](http://github.com/mrdoob))
* Added [Maya exporter](https://github.com/mrdoob/three.js/tree/master/utils/exporters/maya) for JSON format. ([etic](http://github.com/etic))
* Improvements to `FlyControls`. ([WestLangley](http://github.com/WestLangley))
* Improvements to `OBJLoader` and `OBJMTLLoader`. ([edwardsp](http://github.com/edwardsp) and [Fktrcfylh](http://github.com/Fktrcfylh))
* Added `.reflect()`, `projectOnVector()` and `projectOnPlane()` to `Vector3`. ([bhouston](http://github.com/bhouston))
* Added `OculusRiftEffect`. ([troffmo5](http://github.com/troffmo5))
* Fixed loading of JSON format 2.0 files in the editor. ([mrdoob](http://github.com/mrdoob) and [drewnoakes](http://github.com/drewnoakes))
* Added `setHSL()` and `getHSL()` to `Color`. ([pksunkara](http://github.com/pksunkara) and [mrdoob](http://github.com/mrdoob))
* Added binary files support to `STLLoader`. ([aleeper](http://github.com/aleeper))
* Removed `setHSV()`, `getHSV()` from `Color`. ([mrdoob](http://github.com/mrdoob))
* Replaced `ColorUtils.adjustHSV()` with `Color`'s `.offsetHSL()`. ([mrdoob](http://github.com/mrdoob))
* Added `Line3`. ([bhouston](http://github.com/bhouston))
* Addded `linewidth` support to `BufferGeometry` lines. ([arodic](http://github.com/arodic))
* Renamed `Box3`/`Line3`/`Plane`/`Ray`/`Sphere`'s `.transform()` to `applyMatrix4()`. ([bhouston](http://github.com/bhouston))
* Added `smoothstep` and `smootherstep` to `Math`. ([bhouston](http://github.com/bhouston))
* Improvements to the editor. ([drewnoakes](http://github.com/drewnoakes))
* Added `.reset()` to `TrackballControls`. ([WestLangley](http://github.com/WestLangley))
* Added two edge detection shader effects. ([zz85](http://github.com/zz85))
* Unit conversion handling in`ColladaLoader`. ([jihoonl](http://github.com/jihoonl))
2013 01 15 - **r55** (406,462 KB, gzip: 96,542 KB)
......
......@@ -3,7 +3,7 @@
* @author Larry Battle / http://bateru.com/news
*/
var THREE = THREE || { REVISION: '56dev' };
var THREE = THREE || { REVISION: '56' };
self.console = self.console || {
......@@ -3185,7 +3185,7 @@ THREE.extend( THREE.Box3.prototype, {
},
transform: function() {
applyMatrix4: function() {
var points = [
new THREE.Vector3(),
......@@ -4684,7 +4684,7 @@ THREE.extend( THREE.Ray.prototype, {
},
transform: function ( matrix4 ) {
applyMatrix4: function ( matrix4 ) {
this.direction.add( this.origin ).applyMatrix4( matrix4 );
this.origin.applyMatrix4( matrix4 );
......@@ -4810,7 +4810,7 @@ THREE.extend( THREE.Sphere.prototype, {
},
transform: function ( matrix ) {
applyMatrix4: function ( matrix ) {
this.center.applyMatrix4( matrix );
this.radius = this.radius * matrix.getMaxScaleOnAxis();
......@@ -5108,12 +5108,12 @@ THREE.extend( THREE.Plane.prototype, {
},
isIntersectionLine: function ( startPoint, endPoint ) {
isIntersectionLine: function ( line ) {
// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.
var startSign = this.distanceToPoint( startPoint );
var endSign = this.distanceToPoint( endPoint );
var startSign = this.distanceToPoint( line.start );
var endSign = this.distanceToPoint( line.end );
return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );
......@@ -5123,20 +5123,20 @@ THREE.extend( THREE.Plane.prototype, {
var v1 = new THREE.Vector3();
return function ( startPoint, endPoint, optionalTarget ) {
return function ( line, optionalTarget ) {
var result = optionalTarget || new THREE.Vector3();
var direction = v1.subVectors( endPoint, startPoint );
var direction = line.delta( v1 );
var denominator = this.normal.dot( direction );
if ( denominator == 0 ) {
// line is coplanar, return origin
if( this.distanceToPoint( startPoint ) == 0 ) {
if( this.distanceToPoint( line.start ) == 0 ) {
return result.copy( startPoint );
return result.copy( line.start );
}
......@@ -5145,7 +5145,7 @@ THREE.extend( THREE.Plane.prototype, {
}
var t = - ( startPoint.dot( this.normal ) + this.constant ) / denominator;
var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
if( t < 0 || t > 1 ) {
......@@ -5153,7 +5153,7 @@ THREE.extend( THREE.Plane.prototype, {
}
return result.copy( direction ).multiplyScalar( t ).add( startPoint );
return result.copy( direction ).multiplyScalar( t ).add( line.start );
};
......@@ -5167,7 +5167,7 @@ THREE.extend( THREE.Plane.prototype, {
},
transform: function() {
applyMatrix4: function() {
var v1 = new THREE.Vector3();
var v2 = new THREE.Vector3();
......@@ -5241,6 +5241,30 @@ THREE.Math = {
},
// http://en.wikipedia.org/wiki/Smoothstep
smoothstep: function ( x, min, max ) {
if ( x <= min ) return 0;
if ( x >= max ) return 1;
x = ( x - min )/( max - min );
return x*x*(3 - 2*x);
},
smootherstep: function ( x, min, max ) {
if ( x <= min ) return 0;
if ( x >= max ) return 1;
x = ( x - min )/( max - min );
return x*x*x*(x*(x*6 - 15) + 10);
},
// Random float from <0, 1> with 16 bits of randomness
// (standard Math.random() creates repetitive patterns when applied over larger space)
......@@ -5906,7 +5930,7 @@ THREE.EventDispatcher = function () {
inverseMatrix.getInverse( object.matrixWorld );
localRay.copy( raycaster.ray ).transform( inverseMatrix );
localRay.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
for ( var f = 0, fl = geometry.faces.length; f < fl; f ++ ) {
......@@ -13225,6 +13249,8 @@ THREE.CanvasRenderer = function ( parameters ) {
console.log( 'THREE.CanvasRenderer', THREE.REVISION );
var smoothstep = THREE.Math.smoothstep;
parameters = parameters || {};
var _this = this,
......@@ -13959,17 +13985,9 @@ THREE.CanvasRenderer = function ( parameters ) {
_near = camera.near;
_far = camera.far;
var depth;
depth = 1 - smoothstep( v1.positionScreen.z * v1.positionScreen.w, _near, _far );
_color1.setRGB( depth, depth, depth );
depth = 1 - smoothstep( v2.positionScreen.z * v2.positionScreen.w, _near, _far )
_color2.setRGB( depth, depth, depth );
depth = 1 - smoothstep( v3.positionScreen.z * v3.positionScreen.w, _near, _far );
_color3.setRGB( depth, depth, depth );
_color1.r = _color1.g = _color1.b = 1 - smoothstep( v1.positionScreen.z * v1.positionScreen.w, _near, _far );
_color2.r = _color2.g = _color2.b = 1 - smoothstep( v2.positionScreen.z * v2.positionScreen.w, _near, _far );
_color3.r = _color3.g = _color3.b = 1 - smoothstep( v3.positionScreen.z * v3.positionScreen.w, _near, _far );
_color4.addColors( _color2, _color3 ).multiplyScalar( 0.5 );
_image = getGradientTexture( _color1, _color2, _color3, _color4 );
......@@ -14390,13 +14408,6 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function smoothstep( value, min, max ) {
var x = ( value - min ) / ( max - min );
return x * x * ( 3 - 2 * x );
}
// Hide anti-alias gaps
function expand( v1, v2 ) {
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -97,7 +97,7 @@
<script src="list.js"></script>
<script>
var REVISION = '55';
var REVISION = '56';
var panel = document.getElementById( 'panel' );
var viewer = document.getElementById( 'viewer' );
......
......@@ -3,7 +3,7 @@
* @author Larry Battle / http://bateru.com/news
*/
var THREE = THREE || { REVISION: '56dev' };
var THREE = THREE || { REVISION: '56' };
self.console = self.console || {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册