Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b4054f2b
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b4054f2b
编写于
4月 24, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
fa4bcdac
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
302 addition
and
369 deletion
+302
-369
build/three.js
build/three.js
+40
-73
build/three.min.js
build/three.min.js
+222
-223
build/three.module.js
build/three.module.js
+40
-73
未找到文件。
build/three.js
浏览文件 @
b4054f2b
...
@@ -2317,8 +2317,6 @@
...
@@ -2317,8 +2317,6 @@
setFromUnitVectors: function () {
setFromUnitVectors: function () {
// http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final
// assumes direction vectors vFrom and vTo are normalized
// assumes direction vectors vFrom and vTo are normalized
var v1 = new Vector3();
var v1 = new Vector3();
...
@@ -15253,8 +15251,6 @@
...
@@ -15253,8 +15251,6 @@
/**
/**
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as
*/
*/
// BoxGeometry
// BoxGeometry
...
@@ -15447,8 +15443,6 @@
...
@@ -15447,8 +15443,6 @@
/**
/**
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
*/
*/
// PlaneGeometry
// PlaneGeometry
...
@@ -25485,8 +25479,6 @@
...
@@ -25485,8 +25479,6 @@
* @author oosmoxiecode
* @author oosmoxiecode
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
*/
*/
// TorusGeometry
// TorusGeometry
...
@@ -32335,18 +32327,6 @@
...
@@ -32335,18 +32327,6 @@
if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );
if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );
// MultiMaterial
if ( json.materials !== undefined ) {
for ( var i = 0, l = json.materials.length; i < l; i ++ ) {
material.materials.push( this.parse( json.materials[ i ] ) );
}
}
return material;
return material;
}
}
...
@@ -33655,8 +33635,27 @@
...
@@ -33655,8 +33635,27 @@
for ( var i = 0, l = json.length; i < l; i ++ ) {
for ( var i = 0, l = json.length; i < l; i ++ ) {
var material = loader.parse( json[ i ] );
var data = json[ i ];
materials[ material.uuid ] = material;
if ( data.type === 'MultiMaterial' ) {
// Deprecated
var array = [];
for ( var j = 0; j < data.materials.length; j ++ ) {
array.push( loader.parse( data.materials[ j ] ) );
}
materials[ data.uuid ] = array;
} else {
materials[ data.uuid ] = loader.parse( data );
}
}
}
...
@@ -40448,7 +40447,7 @@
...
@@ -40448,7 +40447,7 @@
this.cone.lookAt( vector2.sub( vector ) );
this.cone.lookAt( vector2.sub( vector ) );
this.cone.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
this.cone.material.color.copy( this.light.color );
};
};
...
@@ -40581,7 +40580,7 @@
...
@@ -40581,7 +40580,7 @@
var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
var material = new MeshBasicMaterial( { wireframe: true, fog: false } );
var material = new MeshBasicMaterial( { wireframe: true, fog: false } );
material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
material.color.copy( this.light.color );
Mesh.call( this, geometry, material );
Mesh.call( this, geometry, material );
...
@@ -40624,7 +40623,7 @@
...
@@ -40624,7 +40623,7 @@
PointLightHelper.prototype.update = function () {
PointLightHelper.prototype.update = function () {
this.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
this.material.color.copy( this.light.color );
/*
/*
var d = this.light.distance;
var d = this.light.distance;
...
@@ -40646,6 +40645,7 @@
...
@@ -40646,6 +40645,7 @@
/**
/**
* @author abelnation / http://github.com/abelnation
* @author abelnation / http://github.com/abelnation
* @author Mugen87 / http://github.com/Mugen87
* @author Mugen87 / http://github.com/Mugen87
* @author WestLangley / http://github.com/WestLangley
*/
*/
function RectAreaLightHelper( light ) {
function RectAreaLightHelper( light ) {
...
@@ -40655,28 +40655,16 @@
...
@@ -40655,28 +40655,16 @@
this.light = light;
this.light = light;
this.light.updateMatrixWorld();
this.light.updateMatrixWorld();
var materialFront = new MeshBasicMaterial( {
this.matrix = light.matrixWorld;
color: light.color,
this.matrixAutoUpdate = false;
fog: false
} );
var materialBack = new MeshBasicMaterial( {
var material = new LineBasicMaterial( { color: light.color } );
color: light.color,
fog: false,
wireframe: true
} );
var geometry = new BufferGeometry();
var geometry = new BufferGeometry();
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 6 * 3 ), 3 ) );
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 5 * 3 ), 3 ) );
// shows the "front" of the light, e.g. where light comes from
this.add( new Mesh( geometry, materialFront ) );
this.add( new Line( geometry, material ) );
// shows the "back" of the light, which does not emit light
this.add( new Mesh( geometry, materialBack ) );
this.update();
this.update();
...
@@ -40689,8 +40677,6 @@
...
@@ -40689,8 +40677,6 @@
this.children[ 0 ].geometry.dispose();
this.children[ 0 ].geometry.dispose();
this.children[ 0 ].material.dispose();
this.children[ 0 ].material.dispose();
this.children[ 1 ].geometry.dispose();
this.children[ 1 ].material.dispose();
};
};
...
@@ -40701,46 +40687,27 @@
...
@@ -40701,46 +40687,27 @@
return function update() {
return function update() {
var mesh1 = this.children[ 0 ];
var line = this.children[ 0 ];
var mesh2 = this.children[ 1 ];
if ( this.light.target ) {
// update material
vector1.setFromMatrixPosition( this.light.matrixWorld );
line.material.color.copy( this.light.color );
vector2.setFromMatrixPosition( this.light.target.matrixWorld );
var lookVec = vector2.clone().sub( vector1 );
mesh1.lookAt( lookVec );
mesh2.lookAt( lookVec );
}
// update materials
mesh1.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
mesh2.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
// calculate new dimensions of the helper
// calculate new dimensions of the helper
var hx = this.light.width * 0.5;
var hx = this.light.width * 0.5;
var hy = this.light.height * 0.5;
var hy = this.light.height * 0.5;
// because the buffer attribute is shared over both geometries, we only have to update once
var position = line.geometry.attributes.position;
var position = mesh1.geometry.getAttribute( 'position' );
var array = position.array;
var array = position.array;
//
first face
//
update vertices
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0;
// second face
array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0;
array[ 9 ] = - hx; array[ 10 ] = hy; array[ 11 ] = 0;
array[ 12 ] = - hx; array[ 13 ] = - hy; array[ 14 ] = 0;
array[ 15 ] = hx; array[ 16 ] = - hy; array[ 17 ] = 0;
position.needsUpdate = true;
position.needsUpdate = true;
...
@@ -40803,8 +40770,8 @@
...
@@ -40803,8 +40770,8 @@
var colors = mesh.geometry.getAttribute( 'color' );
var colors = mesh.geometry.getAttribute( 'color' );
color1.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
color1.copy( this.light.color );
color2.copy( this.light.groundColor )
.multiplyScalar( this.light.intensity )
;
color2.copy( this.light.groundColor );
for ( var i = 0, l = colors.count; i < l; i ++ ) {
for ( var i = 0, l = colors.count; i < l; i ++ ) {
...
@@ -41133,7 +41100,7 @@
...
@@ -41133,7 +41100,7 @@
var targetLine = this.children[ 1 ];
var targetLine = this.children[ 1 ];
lightPlane.lookAt( v3 );
lightPlane.lookAt( v3 );
lightPlane.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
lightPlane.material.color.copy( this.light.color );
targetLine.lookAt( v3 );
targetLine.lookAt( v3 );
targetLine.scale.z = v3.length();
targetLine.scale.z = v3.length();
...
...
build/three.min.js
浏览文件 @
b4054f2b
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/three.module.js
浏览文件 @
b4054f2b
...
@@ -2311,8 +2311,6 @@ Object.assign( Quaternion.prototype, {
...
@@ -2311,8 +2311,6 @@ Object.assign( Quaternion.prototype, {
setFromUnitVectors: function () {
setFromUnitVectors: function () {
// http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final
// assumes direction vectors vFrom and vTo are normalized
// assumes direction vectors vFrom and vTo are normalized
var v1 = new Vector3();
var v1 = new Vector3();
...
@@ -15247,8 +15245,6 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
...
@@ -15247,8 +15245,6 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
/**
/**
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as
*/
*/
// BoxGeometry
// BoxGeometry
...
@@ -15441,8 +15437,6 @@ BoxBufferGeometry.prototype.constructor = BoxBufferGeometry;
...
@@ -15441,8 +15437,6 @@ BoxBufferGeometry.prototype.constructor = BoxBufferGeometry;
/**
/**
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
*/
*/
// PlaneGeometry
// PlaneGeometry
...
@@ -25479,8 +25473,6 @@ TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry;
...
@@ -25479,8 +25473,6 @@ TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry;
* @author oosmoxiecode
* @author oosmoxiecode
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
* @author Mugen87 / https://github.com/Mugen87
* @author Mugen87 / https://github.com/Mugen87
*
* based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
*/
*/
// TorusGeometry
// TorusGeometry
...
@@ -32329,18 +32321,6 @@ Object.assign( MaterialLoader.prototype, {
...
@@ -32329,18 +32321,6 @@ Object.assign( MaterialLoader.prototype, {
if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );
if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );
// MultiMaterial
if ( json.materials !== undefined ) {
for ( var i = 0, l = json.materials.length; i < l; i ++ ) {
material.materials.push( this.parse( json.materials[ i ] ) );
}
}
return material;
return material;
}
}
...
@@ -33649,8 +33629,27 @@ Object.assign( ObjectLoader.prototype, {
...
@@ -33649,8 +33629,27 @@ Object.assign( ObjectLoader.prototype, {
for ( var i = 0, l = json.length; i < l; i ++ ) {
for ( var i = 0, l = json.length; i < l; i ++ ) {
var material = loader.parse( json[ i ] );
var data = json[ i ];
materials[ material.uuid ] = material;
if ( data.type === 'MultiMaterial' ) {
// Deprecated
var array = [];
for ( var j = 0; j < data.materials.length; j ++ ) {
array.push( loader.parse( data.materials[ j ] ) );
}
materials[ data.uuid ] = array;
} else {
materials[ data.uuid ] = loader.parse( data );
}
}
}
...
@@ -40442,7 +40441,7 @@ SpotLightHelper.prototype.update = function () {
...
@@ -40442,7 +40441,7 @@ SpotLightHelper.prototype.update = function () {
this.cone.lookAt( vector2.sub( vector ) );
this.cone.lookAt( vector2.sub( vector ) );
this.cone.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
this.cone.material.color.copy( this.light.color );
};
};
...
@@ -40575,7 +40574,7 @@ function PointLightHelper( light, sphereSize ) {
...
@@ -40575,7 +40574,7 @@ function PointLightHelper( light, sphereSize ) {
var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
var material = new MeshBasicMaterial( { wireframe: true, fog: false } );
var material = new MeshBasicMaterial( { wireframe: true, fog: false } );
material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
material.color.copy( this.light.color );
Mesh.call( this, geometry, material );
Mesh.call( this, geometry, material );
...
@@ -40618,7 +40617,7 @@ PointLightHelper.prototype.dispose = function () {
...
@@ -40618,7 +40617,7 @@ PointLightHelper.prototype.dispose = function () {
PointLightHelper.prototype.update = function () {
PointLightHelper.prototype.update = function () {
this.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
this.material.color.copy( this.light.color );
/*
/*
var d = this.light.distance;
var d = this.light.distance;
...
@@ -40640,6 +40639,7 @@ PointLightHelper.prototype.update = function () {
...
@@ -40640,6 +40639,7 @@ PointLightHelper.prototype.update = function () {
/**
/**
* @author abelnation / http://github.com/abelnation
* @author abelnation / http://github.com/abelnation
* @author Mugen87 / http://github.com/Mugen87
* @author Mugen87 / http://github.com/Mugen87
* @author WestLangley / http://github.com/WestLangley
*/
*/
function RectAreaLightHelper( light ) {
function RectAreaLightHelper( light ) {
...
@@ -40649,28 +40649,16 @@ function RectAreaLightHelper( light ) {
...
@@ -40649,28 +40649,16 @@ function RectAreaLightHelper( light ) {
this.light = light;
this.light = light;
this.light.updateMatrixWorld();
this.light.updateMatrixWorld();
var materialFront = new MeshBasicMaterial( {
this.matrix = light.matrixWorld;
color: light.color,
this.matrixAutoUpdate = false;
fog: false
} );
var materialBack = new MeshBasicMaterial( {
var material = new LineBasicMaterial( { color: light.color } );
color: light.color,
fog: false,
wireframe: true
} );
var geometry = new BufferGeometry();
var geometry = new BufferGeometry();
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 6 * 3 ), 3 ) );
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 5 * 3 ), 3 ) );
// shows the "front" of the light, e.g. where light comes from
this.add( new Mesh( geometry, materialFront ) );
this.add( new Line( geometry, material ) );
// shows the "back" of the light, which does not emit light
this.add( new Mesh( geometry, materialBack ) );
this.update();
this.update();
...
@@ -40683,8 +40671,6 @@ RectAreaLightHelper.prototype.dispose = function () {
...
@@ -40683,8 +40671,6 @@ RectAreaLightHelper.prototype.dispose = function () {
this.children[ 0 ].geometry.dispose();
this.children[ 0 ].geometry.dispose();
this.children[ 0 ].material.dispose();
this.children[ 0 ].material.dispose();
this.children[ 1 ].geometry.dispose();
this.children[ 1 ].material.dispose();
};
};
...
@@ -40695,46 +40681,27 @@ RectAreaLightHelper.prototype.update = function () {
...
@@ -40695,46 +40681,27 @@ RectAreaLightHelper.prototype.update = function () {
return function update() {
return function update() {
var mesh1 = this.children[ 0 ];
var line = this.children[ 0 ];
var mesh2 = this.children[ 1 ];
if ( this.light.target ) {
// update material
vector1.setFromMatrixPosition( this.light.matrixWorld );
line.material.color.copy( this.light.color );
vector2.setFromMatrixPosition( this.light.target.matrixWorld );
var lookVec = vector2.clone().sub( vector1 );
mesh1.lookAt( lookVec );
mesh2.lookAt( lookVec );
}
// update materials
mesh1.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
mesh2.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
// calculate new dimensions of the helper
// calculate new dimensions of the helper
var hx = this.light.width * 0.5;
var hx = this.light.width * 0.5;
var hy = this.light.height * 0.5;
var hy = this.light.height * 0.5;
// because the buffer attribute is shared over both geometries, we only have to update once
var position = line.geometry.attributes.position;
var position = mesh1.geometry.getAttribute( 'position' );
var array = position.array;
var array = position.array;
//
first face
//
update vertices
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0;
// second face
array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0;
array[ 9 ] = - hx; array[ 10 ] = hy; array[ 11 ] = 0;
array[ 12 ] = - hx; array[ 13 ] = - hy; array[ 14 ] = 0;
array[ 15 ] = hx; array[ 16 ] = - hy; array[ 17 ] = 0;
position.needsUpdate = true;
position.needsUpdate = true;
...
@@ -40797,8 +40764,8 @@ HemisphereLightHelper.prototype.update = function () {
...
@@ -40797,8 +40764,8 @@ HemisphereLightHelper.prototype.update = function () {
var colors = mesh.geometry.getAttribute( 'color' );
var colors = mesh.geometry.getAttribute( 'color' );
color1.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
color1.copy( this.light.color );
color2.copy( this.light.groundColor )
.multiplyScalar( this.light.intensity )
;
color2.copy( this.light.groundColor );
for ( var i = 0, l = colors.count; i < l; i ++ ) {
for ( var i = 0, l = colors.count; i < l; i ++ ) {
...
@@ -41127,7 +41094,7 @@ DirectionalLightHelper.prototype.update = function () {
...
@@ -41127,7 +41094,7 @@ DirectionalLightHelper.prototype.update = function () {
var targetLine = this.children[ 1 ];
var targetLine = this.children[ 1 ];
lightPlane.lookAt( v3 );
lightPlane.lookAt( v3 );
lightPlane.material.color.copy( this.light.color )
.multiplyScalar( this.light.intensity )
;
lightPlane.material.color.copy( this.light.color );
targetLine.lookAt( v3 );
targetLine.lookAt( v3 );
targetLine.scale.z = v3.length();
targetLine.scale.z = v3.length();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录