Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
6c9130b1
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
6c9130b1
编写于
11月 23, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
7a86ecac
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
592 addition
and
579 deletion
+592
-579
build/three.js
build/three.js
+50
-43
build/three.min.js
build/three.min.js
+492
-493
build/three.modules.js
build/three.modules.js
+50
-43
未找到文件。
build/three.js
浏览文件 @
6c9130b1
...
...
@@ -40179,6 +40179,7 @@
/**
* @author abelnation / http://github.com/abelnation
* @author Mugen87 / http://github.com/Mugen87
*/
function RectAreaLightHelper( light ) {
...
...
@@ -40188,37 +40189,28 @@
this.light = light;
this.light.updateMatrixWorld();
this.lightMa
t = new MeshBasicMaterial( {
var materialFron
t = new MeshBasicMaterial( {
color: light.color,
fog: false
} );
this.lightWireMat
= new MeshBasicMaterial( {
var materialBack
= new MeshBasicMaterial( {
color: light.color,
fog: false,
wireframe: true
} );
var hx = this.light.width / 2.0;
var hy = this.light.height / 2.0;
var geometry = new BufferGeometry();
this.lightShape = new ShapeBufferGeometry( new Shape( [
new Vector3( - hx, hy, 0 ),
new Vector3( hx, hy, 0 ),
new Vector3( hx, - hy, 0 ),
new Vector3( - hx, - hy, 0 )
] ) );
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 6 * 3 ), 3 ) );
// shows the "front" of the light, e.g. where light comes from
this.
lightMesh = new Mesh( this.lightShape, this.lightMat
);
this.
add( new Mesh( geometry, materialFront )
);
// shows the "back" of the light, which does not emit light
this.lightWireMesh = new Mesh( this.lightShape, this.lightWireMat );
this.add( this.lightMesh );
this.add( this.lightWireMesh );
this.add( new Mesh( geometry, materialBack ) );
this.update();
...
...
@@ -40229,51 +40221,66 @@
RectAreaLightHelper.prototype.dispose = function () {
this.
lightMesh
.geometry.dispose();
this.
lightMesh
.material.dispose();
this.
lightWireMesh
.geometry.dispose();
this.
lightWireMesh
.material.dispose();
this.
children[ 0 ]
.geometry.dispose();
this.
children[ 0 ]
.material.dispose();
this.
children[ 1 ]
.geometry.dispose();
this.
children[ 1 ]
.material.dispose();
};
RectAreaLightHelper.prototype.update = function () {
var vector = new Vector3();
var vector
1
= new Vector3();
var vector2 = new Vector3();
// TODO (abelnation) why not just make light helpers a child of the light object?
if ( this.light.target ) {
return function update() {
v
ector.setFromMatrixPosition( this.light.matrixWorld )
;
v
ector2.setFromMatrixPosition( this.light.target.matrixWorld )
;
v
ar mesh1 = this.children[ 0 ]
;
v
ar mesh2 = this.children[ 1 ]
;
var lookVec = vector2.clone().sub( vector );
this.lightMesh.lookAt( lookVec );
this.lightWireMesh.lookAt( lookVec );
if ( this.light.target ) {
}
vector1.setFromMatrixPosition( this.light.matrixWorld );
vector2.setFromMatrixPosition( this.light.target.matrixWorld );
this.lightMesh.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
this.lightWireMesh.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
var lookVec = vector2.clone().sub( vector1 );
mesh1.lookAt( lookVec );
mesh2.lookAt( lookVec );
var oldShape = this.lightShape;
}
var hx = this.light.width / 2.0;
var hy = this.light.height / 2.0;
// update materials
this.lightShape = new ShapeBufferGeometry( new Shape( [
new Vector3( - hx, hy, 0 ),
new Vector3( hx, hy, 0 ),
new Vector3( hx, - hy, 0 ),
new Vector3( - hx, - hy, 0 )
] ) );
mesh1.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
mesh2.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
this.lightMesh.geometry = this.lightShape;
this.lightWireMesh.geometry = this.lightShape;
// calculate new dimensions of the helper
oldShape.dispose();
var hx = this.light.width * 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 = mesh1.geometry.getAttribute( 'position' );
var array = position.array;
// first face
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
// second face
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;
};
}();
/**
* @author alteredq / http://alteredqualia.com/
...
...
build/three.min.js
浏览文件 @
6c9130b1
此差异已折叠。
点击以展开。
build/three.modules.js
浏览文件 @
6c9130b1
...
...
@@ -40173,6 +40173,7 @@ PointLightHelper.prototype.update = function () {
/**
* @author abelnation / http://github.com/abelnation
* @author Mugen87 / http://github.com/Mugen87
*/
function RectAreaLightHelper( light ) {
...
...
@@ -40182,37 +40183,28 @@ function RectAreaLightHelper( light ) {
this.light = light;
this.light.updateMatrixWorld();
this.lightMa
t = new MeshBasicMaterial( {
var materialFron
t = new MeshBasicMaterial( {
color: light.color,
fog: false
} );
this.lightWireMat
= new MeshBasicMaterial( {
var materialBack
= new MeshBasicMaterial( {
color: light.color,
fog: false,
wireframe: true
} );
var hx = this.light.width / 2.0;
var hy = this.light.height / 2.0;
var geometry = new BufferGeometry();
this.lightShape = new ShapeBufferGeometry( new Shape( [
new Vector3( - hx, hy, 0 ),
new Vector3( hx, hy, 0 ),
new Vector3( hx, - hy, 0 ),
new Vector3( - hx, - hy, 0 )
] ) );
geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 6 * 3 ), 3 ) );
// shows the "front" of the light, e.g. where light comes from
this.
lightMesh = new Mesh( this.lightShape, this.lightMat
);
this.
add( new Mesh( geometry, materialFront )
);
// shows the "back" of the light, which does not emit light
this.lightWireMesh = new Mesh( this.lightShape, this.lightWireMat );
this.add( this.lightMesh );
this.add( this.lightWireMesh );
this.add( new Mesh( geometry, materialBack ) );
this.update();
...
...
@@ -40223,51 +40215,66 @@ RectAreaLightHelper.prototype.constructor = RectAreaLightHelper;
RectAreaLightHelper.prototype.dispose = function () {
this.
lightMesh
.geometry.dispose();
this.
lightMesh
.material.dispose();
this.
lightWireMesh
.geometry.dispose();
this.
lightWireMesh
.material.dispose();
this.
children[ 0 ]
.geometry.dispose();
this.
children[ 0 ]
.material.dispose();
this.
children[ 1 ]
.geometry.dispose();
this.
children[ 1 ]
.material.dispose();
};
RectAreaLightHelper.prototype.update = function () {
var vector = new Vector3();
var vector
1
= new Vector3();
var vector2 = new Vector3();
// TODO (abelnation) why not just make light helpers a child of the light object?
if ( this.light.target ) {
return function update() {
v
ector.setFromMatrixPosition( this.light.matrixWorld )
;
v
ector2.setFromMatrixPosition( this.light.target.matrixWorld )
;
v
ar mesh1 = this.children[ 0 ]
;
v
ar mesh2 = this.children[ 1 ]
;
var lookVec = vector2.clone().sub( vector );
this.lightMesh.lookAt( lookVec );
this.lightWireMesh.lookAt( lookVec );
if ( this.light.target ) {
}
vector1.setFromMatrixPosition( this.light.matrixWorld );
vector2.setFromMatrixPosition( this.light.target.matrixWorld );
this.lightMesh.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
this.lightWireMesh.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
var lookVec = vector2.clone().sub( vector1 );
mesh1.lookAt( lookVec );
mesh2.lookAt( lookVec );
var oldShape = this.lightShape;
}
var hx = this.light.width / 2.0;
var hy = this.light.height / 2.0;
// update materials
this.lightShape = new ShapeBufferGeometry( new Shape( [
new Vector3( - hx, hy, 0 ),
new Vector3( hx, hy, 0 ),
new Vector3( hx, - hy, 0 ),
new Vector3( - hx, - hy, 0 )
] ) );
mesh1.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
mesh2.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
this.lightMesh.geometry = this.lightShape;
this.lightWireMesh.geometry = this.lightShape;
// calculate new dimensions of the helper
oldShape.dispose();
var hx = this.light.width * 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 = mesh1.geometry.getAttribute( 'position' );
var array = position.array;
// first face
array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0;
array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0;
array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0;
// second face
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;
};
}();
/**
* @author alteredq / http://alteredqualia.com/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录