Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
a49ec884
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,发现更多精彩内容 >>
提交
a49ec884
编写于
6月 18, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
9bbe5780
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
3 deletion
+15
-3
build/three.js
build/three.js
+13
-2
build/three.min.js
build/three.min.js
+2
-1
未找到文件。
build/three.js
浏览文件 @
a49ec884
...
...
@@ -35023,7 +35023,9 @@ THREE.GridHelper = function ( size, step ) {
var geometry = new THREE.Geometry();
var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
var color1 = new THREE.Color( 0x444444 ), color2 = new THREE.Color( 0x888888 );
this.color1 = new THREE.Color( 0x444444 );
this.color2 = new THREE.Color( 0x888888 );
for ( var i = - size; i <= size; i += step ) {
...
...
@@ -35032,7 +35034,7 @@ THREE.GridHelper = function ( size, step ) {
new THREE.Vector3( i, 0, - size ), new THREE.Vector3( i, 0, size )
);
var color = i === 0 ?
color1 :
color2;
var color = i === 0 ?
this.color1 : this.
color2;
geometry.colors.push( color, color, color, color );
...
...
@@ -35044,6 +35046,15 @@ THREE.GridHelper = function ( size, step ) {
THREE.GridHelper.prototype = Object.create( THREE.Line.prototype );
THREE.GridHelper.prototype.setColors = function( colorCenterLine, colorGrid ) {
this.color1.set( colorCenterLine );
this.color2.set( colorGrid );
this.geometry.colorsNeedUpdate = true;
}
/**
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
...
...
build/three.min.js
浏览文件 @
a49ec884
...
...
@@ -663,7 +663,8 @@ THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THR
c
.
computeLineDistances
();
d
=
new
THREE
.
LineDashedMaterial
({
dashSize
:
4
,
gapSize
:
4
,
opacity
:
0.75
,
transparent
:
!
0
,
fog
:
!
1
});
d
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
);
this
.
targetLine
=
new
THREE
.
Line
(
c
,
d
);
this
.
add
(
this
.
targetLine
)};
THREE
.
DirectionalLightHelper
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
DirectionalLightHelper
.
prototype
.
update
=
function
(){
this
.
lightSphere
.
material
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
);
this
.
targetLine
.
geometry
.
computeLineDistances
();
this
.
targetLine
.
geometry
.
verticesNeedUpdate
=!
0
;
this
.
targetLine
.
material
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
)};
THREE
.
FaceNormalsHelper
=
function
(
a
,
b
,
c
,
d
){
this
.
object
=
a
;
this
.
size
=
b
||
1
;
for
(
var
a
=
c
||
16776960
,
d
=
d
||
1
,
b
=
new
THREE
.
Geometry
,
c
=
0
,
e
=
this
.
object
.
geometry
.
faces
.
length
;
c
<
e
;
c
++
)
b
.
vertices
.
push
(
new
THREE
.
Vector3
),
b
.
vertices
.
push
(
new
THREE
.
Vector3
);
THREE
.
Line
.
call
(
this
,
b
,
new
THREE
.
LineBasicMaterial
({
color
:
a
,
linewidth
:
d
}),
THREE
.
LinePieces
);
this
.
matrixAutoUpdate
=!
1
;
this
.
normalMatrix
=
new
THREE
.
Matrix3
;
this
.
update
()};
THREE
.
FaceNormalsHelper
.
prototype
=
Object
.
create
(
THREE
.
Line
.
prototype
);
THREE
.
FaceNormalsHelper
.
prototype
.
update
=
function
(){
var
a
=
new
THREE
.
Vector3
;
return
function
(){
this
.
object
.
updateMatrixWorld
(
!
0
);
this
.
normalMatrix
.
getNormalMatrix
(
this
.
object
.
matrixWorld
);
for
(
var
b
=
this
.
geometry
.
vertices
,
c
=
this
.
object
.
geometry
.
faces
,
d
=
this
.
object
.
matrixWorld
,
e
=
0
,
f
=
c
.
length
;
e
<
f
;
e
++
){
var
g
=
c
[
e
];
a
.
copy
(
g
.
normal
).
applyMatrix3
(
this
.
normalMatrix
).
normalize
().
multiplyScalar
(
this
.
size
);
var
h
=
2
*
e
;
b
[
h
].
copy
(
g
.
centroid
).
applyMatrix4
(
d
);
b
[
h
+
1
].
addVectors
(
b
[
h
],
a
)}
this
.
geometry
.
verticesNeedUpdate
=
!
0
;
return
this
}}();
THREE
.
GridHelper
=
function
(
a
,
b
){
for
(
var
c
=
new
THREE
.
Geometry
,
d
=
new
THREE
.
LineBasicMaterial
({
vertexColors
:
THREE
.
VertexColors
}),
e
=
new
THREE
.
Color
(
4473924
),
f
=
new
THREE
.
Color
(
8947848
),
g
=-
a
;
g
<=
a
;
g
+=
b
){
c
.
vertices
.
push
(
new
THREE
.
Vector3
(
-
a
,
0
,
g
),
new
THREE
.
Vector3
(
a
,
0
,
g
),
new
THREE
.
Vector3
(
g
,
0
,
-
a
),
new
THREE
.
Vector3
(
g
,
0
,
a
));
var
h
=
0
===
g
?
e
:
f
;
c
.
colors
.
push
(
h
,
h
,
h
,
h
)}
THREE
.
Line
.
call
(
this
,
c
,
d
,
THREE
.
LinePieces
)};
THREE
.
GridHelper
.
prototype
=
Object
.
create
(
THREE
.
Line
.
prototype
);
THREE
.
HemisphereLightHelper
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
light
=
a
;
var
c
=
new
THREE
.
SphereGeometry
(
b
,
4
,
2
);
c
.
applyMatrix
((
new
THREE
.
Matrix4
).
makeRotationX
(
-
Math
.
PI
/
2
));
for
(
var
d
=
0
;
8
>
d
;
d
++
)
c
.
faces
[
d
].
materialIndex
=
4
>
d
?
0
:
1
;
d
=
new
THREE
.
MeshBasicMaterial
({
fog
:
!
1
,
wireframe
:
!
0
});
d
.
color
.
copy
(
a
.
color
).
multiplyScalar
(
a
.
intensity
);
var
e
=
new
THREE
.
MeshBasicMaterial
({
fog
:
!
1
,
wireframe
:
!
0
});
e
.
color
.
copy
(
a
.
groundColor
).
multiplyScalar
(
a
.
intensity
);
this
.
lightSphere
=
new
THREE
.
Mesh
(
c
,
new
THREE
.
MeshFaceMaterial
([
d
,
!
0
;
return
this
}}();
THREE
.
GridHelper
=
function
(
a
,
b
){
var
c
=
new
THREE
.
Geometry
,
d
=
new
THREE
.
LineBasicMaterial
({
vertexColors
:
THREE
.
VertexColors
});
this
.
color1
=
new
THREE
.
Color
(
4473924
);
this
.
color2
=
new
THREE
.
Color
(
8947848
);
for
(
var
e
=-
a
;
e
<=
a
;
e
+=
b
){
c
.
vertices
.
push
(
new
THREE
.
Vector3
(
-
a
,
0
,
e
),
new
THREE
.
Vector3
(
a
,
0
,
e
),
new
THREE
.
Vector3
(
e
,
0
,
-
a
),
new
THREE
.
Vector3
(
e
,
0
,
a
));
var
f
=
0
===
e
?
this
.
color1
:
this
.
color2
;
c
.
colors
.
push
(
f
,
f
,
f
,
f
)}
THREE
.
Line
.
call
(
this
,
c
,
d
,
THREE
.
LinePieces
)};
THREE
.
GridHelper
.
prototype
=
Object
.
create
(
THREE
.
Line
.
prototype
);
THREE
.
GridHelper
.
prototype
.
setColors
=
function
(
a
,
b
){
this
.
color1
.
set
(
a
);
this
.
color2
.
set
(
b
);
this
.
geometry
.
colorsNeedUpdate
=!
0
};
THREE
.
HemisphereLightHelper
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
light
=
a
;
var
c
=
new
THREE
.
SphereGeometry
(
b
,
4
,
2
);
c
.
applyMatrix
((
new
THREE
.
Matrix4
).
makeRotationX
(
-
Math
.
PI
/
2
));
for
(
var
d
=
0
;
8
>
d
;
d
++
)
c
.
faces
[
d
].
materialIndex
=
4
>
d
?
0
:
1
;
d
=
new
THREE
.
MeshBasicMaterial
({
fog
:
!
1
,
wireframe
:
!
0
});
d
.
color
.
copy
(
a
.
color
).
multiplyScalar
(
a
.
intensity
);
var
e
=
new
THREE
.
MeshBasicMaterial
({
fog
:
!
1
,
wireframe
:
!
0
});
e
.
color
.
copy
(
a
.
groundColor
).
multiplyScalar
(
a
.
intensity
);
this
.
lightSphere
=
new
THREE
.
Mesh
(
c
,
new
THREE
.
MeshFaceMaterial
([
d
,
e
]));
this
.
lightSphere
.
position
=
a
.
position
;
this
.
lightSphere
.
lookAt
(
new
THREE
.
Vector3
);
this
.
add
(
this
.
lightSphere
)};
THREE
.
HemisphereLightHelper
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
HemisphereLightHelper
.
prototype
.
update
=
function
(){
this
.
lightSphere
.
lookAt
(
new
THREE
.
Vector3
);
this
.
lightSphere
.
material
.
materials
[
0
].
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
);
this
.
lightSphere
.
material
.
materials
[
1
].
color
.
copy
(
this
.
light
.
groundColor
).
multiplyScalar
(
this
.
light
.
intensity
)};
THREE
.
PointLightHelper
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixAutoUpdate
=!
1
;
this
.
light
=
a
;
var
c
=
new
THREE
.
SphereGeometry
(
b
,
4
,
2
),
d
=
new
THREE
.
MeshBasicMaterial
({
fog
:
!
1
,
wireframe
:
!
0
});
d
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
);
this
.
lightSphere
=
new
THREE
.
Mesh
(
c
,
d
);
this
.
lightSphere
.
matrixWorld
=
this
.
light
.
matrixWorld
;
this
.
lightSphere
.
matrixAutoUpdate
=!
1
;
this
.
add
(
this
.
lightSphere
)};
THREE
.
PointLightHelper
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
PointLightHelper
.
prototype
.
update
=
function
(){
this
.
lightSphere
.
material
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
)};
THREE
.
SpotLightHelper
=
function
(
a
){
this
.
light
=
a
;
a
=
new
THREE
.
CylinderGeometry
(
0
,
1
,
1
,
8
,
1
,
!
0
);
a
.
applyMatrix
((
new
THREE
.
Matrix4
).
makeTranslation
(
0
,
-
0.5
,
0
));
a
.
applyMatrix
((
new
THREE
.
Matrix4
).
makeRotationX
(
-
Math
.
PI
/
2
));
var
b
=
new
THREE
.
MeshBasicMaterial
({
wireframe
:
!
0
,
opacity
:
0.3
,
transparent
:
!
0
});
THREE
.
Mesh
.
call
(
this
,
a
,
b
);
this
.
update
()};
THREE
.
SpotLightHelper
.
prototype
=
Object
.
create
(
THREE
.
Mesh
.
prototype
);
THREE
.
SpotLightHelper
.
prototype
.
update
=
function
(){
var
a
=
new
THREE
.
Vector3
;
return
function
(){
var
b
=
this
.
light
.
distance
?
this
.
light
.
distance
:
1
E4
,
c
=
b
*
Math
.
tan
(
this
.
light
.
angle
);
this
.
scale
.
set
(
c
,
c
,
b
);
this
.
light
.
updateMatrixWorld
(
!
0
);
this
.
position
.
getPositionFromMatrix
(
this
.
light
.
matrixWorld
);
this
.
light
.
target
.
updateMatrixWorld
(
!
0
);
a
.
getPositionFromMatrix
(
this
.
light
.
target
.
matrixWorld
);
this
.
lookAt
(
a
);
this
.
material
.
color
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
)}}();
THREE
.
VertexNormalsHelper
=
function
(
a
,
b
,
c
,
d
){
this
.
object
=
a
;
this
.
size
=
b
||
1
;
for
(
var
b
=
c
||
16711680
,
d
=
d
||
1
,
c
=
new
THREE
.
Geometry
,
a
=
a
.
geometry
.
faces
,
e
=
0
,
f
=
a
.
length
;
e
<
f
;
e
++
)
for
(
var
g
=
0
,
h
=
a
[
e
].
vertexNormals
.
length
;
g
<
h
;
g
++
)
c
.
vertices
.
push
(
new
THREE
.
Vector3
),
c
.
vertices
.
push
(
new
THREE
.
Vector3
);
THREE
.
Line
.
call
(
this
,
c
,
new
THREE
.
LineBasicMaterial
({
color
:
b
,
linewidth
:
d
}),
THREE
.
LinePieces
);
this
.
matrixAutoUpdate
=!
1
;
this
.
normalMatrix
=
new
THREE
.
Matrix3
;
this
.
update
()};
THREE
.
VertexNormalsHelper
.
prototype
=
Object
.
create
(
THREE
.
Line
.
prototype
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录