Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
51ef917f
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,发现更多精彩内容 >>
提交
51ef917f
编写于
8月 16, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
2dba6ba1
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
5 addition
and
5 deletion
+5
-5
build/three.js
build/three.js
+2
-2
build/three.min.js
build/three.min.js
+3
-3
未找到文件。
build/three.js
浏览文件 @
51ef917f
...
...
@@ -9956,7 +9956,7 @@ THREE.HemisphereLight.prototype = Object.create( THREE.Light.prototype );
THREE.HemisphereLight.prototype.clone = function () {
var light = new THREE.
Point
Light();
var light = new THREE.
Hemisphere
Light();
THREE.Light.prototype.clone.call( this, light );
...
...
@@ -31660,7 +31660,7 @@ THREE.CubeGeometry = function ( width, height, depth, widthSegments, heightSegme
face.materialIndex = materialIndex;
scope.faces.push( face );
scope.faceVertexUvs[ 0 ].push( [ uvb
, uvc, uvd
] );
scope.faceVertexUvs[ 0 ].push( [ uvb
.clone(), uvc, uvd.clone()
] );
}
...
...
build/three.min.js
浏览文件 @
51ef917f
...
...
@@ -200,7 +200,7 @@ THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullW
THREE
.
PerspectiveCamera
.
prototype
.
updateProjectionMatrix
=
function
(){
if
(
this
.
fullWidth
){
var
a
=
this
.
fullWidth
/
this
.
fullHeight
,
b
=
Math
.
tan
(
THREE
.
Math
.
degToRad
(
0.5
*
this
.
fov
))
*
this
.
near
,
c
=-
b
,
d
=
a
*
c
,
a
=
Math
.
abs
(
a
*
b
-
d
),
c
=
Math
.
abs
(
b
-
c
);
this
.
projectionMatrix
.
makeFrustum
(
d
+
this
.
x
*
a
/
this
.
fullWidth
,
d
+
(
this
.
x
+
this
.
width
)
*
a
/
this
.
fullWidth
,
b
-
(
this
.
y
+
this
.
height
)
*
c
/
this
.
fullHeight
,
b
-
this
.
y
*
c
/
this
.
fullHeight
,
this
.
near
,
this
.
far
)}
else
this
.
projectionMatrix
.
makePerspective
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
)};
THREE
.
PerspectiveCamera
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
PerspectiveCamera
;
THREE
.
Camera
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
fov
=
this
.
fov
;
a
.
aspect
=
this
.
aspect
;
a
.
near
=
this
.
near
;
a
.
far
=
this
.
far
;
return
a
};
THREE
.
Light
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
color
=
new
THREE
.
Color
(
a
)};
THREE
.
Light
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Light
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Light
);
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
color
.
copy
(
this
.
color
);
return
a
};
THREE
.
AmbientLight
=
function
(
a
){
THREE
.
Light
.
call
(
this
,
a
)};
THREE
.
AmbientLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
AmbientLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
AmbientLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
THREE
.
AreaLight
=
function
(
a
,
b
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
normal
=
new
THREE
.
Vector3
(
0
,
-
1
,
0
);
this
.
right
=
new
THREE
.
Vector3
(
1
,
0
,
0
);
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
height
=
this
.
width
=
1
;
this
.
constantAttenuation
=
1.5
;
this
.
linearAttenuation
=
0.5
;
this
.
quadraticAttenuation
=
0.1
};
THREE
.
AreaLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
DirectionalLight
=
function
(
a
,
b
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
.
set
(
0
,
1
,
0
);
this
.
target
=
new
THREE
.
Object3D
;
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
onlyShadow
=
this
.
castShadow
=!
1
;
this
.
shadowCameraNear
=
50
;
this
.
shadowCameraFar
=
5
E3
;
this
.
shadowCameraLeft
=-
500
;
this
.
shadowCameraTop
=
this
.
shadowCameraRight
=
500
;
this
.
shadowCameraBottom
=-
500
;
this
.
shadowCameraVisible
=!
1
;
this
.
shadowBias
=
0
;
this
.
shadowDarkness
=
0.5
;
this
.
shadowMapHeight
=
this
.
shadowMapWidth
=
512
;
this
.
shadowCascade
=!
1
;
this
.
shadowCascadeOffset
=
new
THREE
.
Vector3
(
0
,
0
,
-
1
E3
);
this
.
shadowCascadeCount
=
2
;
this
.
shadowCascadeBias
=
[
0
,
0
,
0
];
this
.
shadowCascadeWidth
=
[
512
,
512
,
512
];
this
.
shadowCascadeHeight
=
[
512
,
512
,
512
];
this
.
shadowCascadeNearZ
=
[
-
1
,
0.99
,
0.998
];
this
.
shadowCascadeFarZ
=
[
0.99
,
0.998
,
1
];
this
.
shadowCascadeArray
=
[];
this
.
shadowMatrix
=
this
.
shadowCamera
=
this
.
shadowMapSize
=
this
.
shadowMap
=
null
};
THREE
.
DirectionalLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
DirectionalLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
DirectionalLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
target
=
this
.
target
.
clone
();
a
.
intensity
=
this
.
intensity
;
a
.
castShadow
=
this
.
castShadow
;
a
.
onlyShadow
=
this
.
onlyShadow
;
return
a
};
THREE
.
HemisphereLight
=
function
(
a
,
b
,
c
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
.
set
(
0
,
100
,
0
);
this
.
groundColor
=
new
THREE
.
Color
(
b
);
this
.
intensity
=
void
0
!==
c
?
c
:
1
};
THREE
.
HemisphereLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
HemisphereLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
Point
Light
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
groundColor
.
copy
(
this
.
groundColor
);
a
.
intensity
=
this
.
intensity
;
return
a
};
THREE
.
PointLight
=
function
(
a
,
b
,
c
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
distance
=
void
0
!==
c
?
c
:
0
};
THREE
.
PointLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
PointLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
PointLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
intensity
=
this
.
intensity
;
a
.
distance
=
this
.
distance
;
return
a
};
THREE
.
SpotLight
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
.
set
(
0
,
1
,
0
);
this
.
target
=
new
THREE
.
Object3D
;
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
distance
=
void
0
!==
c
?
c
:
0
;
this
.
angle
=
void
0
!==
d
?
d
:
Math
.
PI
/
3
;
this
.
exponent
=
void
0
!==
e
?
e
:
10
;
this
.
onlyShadow
=
this
.
castShadow
=!
1
;
this
.
shadowCameraNear
=
50
;
this
.
shadowCameraFar
=
5
E3
;
this
.
shadowCameraFov
=
50
;
this
.
shadowCameraVisible
=!
1
;
this
.
shadowBias
=
0
;
this
.
shadowDarkness
=
0.5
;
this
.
shadowMapHeight
=
this
.
shadowMapWidth
=
512
;
this
.
shadowMatrix
=
this
.
shadowCamera
=
this
.
shadowMapSize
=
THREE
.
DirectionalLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
DirectionalLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
target
=
this
.
target
.
clone
();
a
.
intensity
=
this
.
intensity
;
a
.
castShadow
=
this
.
castShadow
;
a
.
onlyShadow
=
this
.
onlyShadow
;
return
a
};
THREE
.
HemisphereLight
=
function
(
a
,
b
,
c
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
.
set
(
0
,
100
,
0
);
this
.
groundColor
=
new
THREE
.
Color
(
b
);
this
.
intensity
=
void
0
!==
c
?
c
:
1
};
THREE
.
HemisphereLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
HemisphereLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
Hemisphere
Light
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
groundColor
.
copy
(
this
.
groundColor
);
a
.
intensity
=
this
.
intensity
;
return
a
};
THREE
.
PointLight
=
function
(
a
,
b
,
c
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
distance
=
void
0
!==
c
?
c
:
0
};
THREE
.
PointLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
PointLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
PointLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
intensity
=
this
.
intensity
;
a
.
distance
=
this
.
distance
;
return
a
};
THREE
.
SpotLight
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
.
set
(
0
,
1
,
0
);
this
.
target
=
new
THREE
.
Object3D
;
this
.
intensity
=
void
0
!==
b
?
b
:
1
;
this
.
distance
=
void
0
!==
c
?
c
:
0
;
this
.
angle
=
void
0
!==
d
?
d
:
Math
.
PI
/
3
;
this
.
exponent
=
void
0
!==
e
?
e
:
10
;
this
.
onlyShadow
=
this
.
castShadow
=!
1
;
this
.
shadowCameraNear
=
50
;
this
.
shadowCameraFar
=
5
E3
;
this
.
shadowCameraFov
=
50
;
this
.
shadowCameraVisible
=!
1
;
this
.
shadowBias
=
0
;
this
.
shadowDarkness
=
0.5
;
this
.
shadowMapHeight
=
this
.
shadowMapWidth
=
512
;
this
.
shadowMatrix
=
this
.
shadowCamera
=
this
.
shadowMapSize
=
this
.
shadowMap
=
null
};
THREE
.
SpotLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
SpotLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
SpotLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
target
=
this
.
target
.
clone
();
a
.
intensity
=
this
.
intensity
;
a
.
distance
=
this
.
distance
;
a
.
angle
=
this
.
angle
;
a
.
exponent
=
this
.
exponent
;
a
.
castShadow
=
this
.
castShadow
;
a
.
onlyShadow
=
this
.
onlyShadow
;
return
a
};
THREE
.
Loader
=
function
(
a
){
this
.
statusDomElement
=
(
this
.
showStatus
=
a
)?
THREE
.
Loader
.
prototype
.
addStatusElement
():
null
;
this
.
onLoadStart
=
function
(){};
this
.
onLoadProgress
=
function
(){};
this
.
onLoadComplete
=
function
(){}};
THREE
.
Loader
.
prototype
=
{
constructor
:
THREE
.
Loader
,
crossOrigin
:
"
anonymous
"
,
addStatusElement
:
function
(){
var
a
=
document
.
createElement
(
"
div
"
);
a
.
style
.
position
=
"
absolute
"
;
a
.
style
.
right
=
"
0px
"
;
a
.
style
.
top
=
"
0px
"
;
a
.
style
.
fontSize
=
"
0.8em
"
;
a
.
style
.
textAlign
=
"
left
"
;
a
.
style
.
background
=
"
rgba(0,0,0,0.25)
"
;
a
.
style
.
color
=
"
#fff
"
;
a
.
style
.
width
=
"
120px
"
;
a
.
style
.
padding
=
"
0.5em 0.5em 0.5em 0.5em
"
;
a
.
style
.
zIndex
=
1
E3
;
a
.
innerHTML
=
"
Loading ...
"
;
return
a
},
updateProgress
:
function
(
a
){
var
b
=
"
Loaded
"
,
b
=
a
.
total
?
b
+
((
100
*
a
.
loaded
/
a
.
total
).
toFixed
(
0
)
+
"
%
"
):
b
+
((
a
.
loaded
/
1
E3
).
toFixed
(
2
)
+
"
KB
"
);
this
.
statusDomElement
.
innerHTML
=
b
},
extractUrlBase
:
function
(
a
){
a
=
a
.
split
(
"
/
"
);
a
.
pop
();
return
(
1
>
a
.
length
?
"
.
"
:
a
.
join
(
"
/
"
))
+
"
/
"
},
initMaterials
:
function
(
a
,
b
){
for
(
var
c
=
[],
d
=
0
;
d
<
a
.
length
;
++
d
)
c
[
d
]
=
THREE
.
Loader
.
prototype
.
createMaterial
(
a
[
d
],
b
);
return
c
},
needsTangents
:
function
(
a
){
for
(
var
b
=
0
,
c
=
a
.
length
;
b
<
c
;
b
++
)
if
(
a
[
b
]
instanceof
THREE
.
ShaderMaterial
)
return
!
0
;
return
!
1
},
createMaterial
:
function
(
a
,
b
){
function
c
(
a
){
a
=
Math
.
log
(
a
)
/
Math
.
LN2
;
return
Math
.
floor
(
a
)
==
...
...
@@ -601,8 +601,8 @@ THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rota
THREE
.
CombinedCamera
.
prototype
.
toTopView
=
function
(){
this
.
rotation
.
x
=-
Math
.
PI
/
2
;
this
.
rotation
.
y
=
0
;
this
.
rotation
.
z
=
0
;
this
.
rotationAutoUpdate
=!
1
};
THREE
.
CombinedCamera
.
prototype
.
toBottomView
=
function
(){
this
.
rotation
.
x
=
Math
.
PI
/
2
;
this
.
rotation
.
y
=
0
;
this
.
rotation
.
z
=
0
;
this
.
rotationAutoUpdate
=!
1
};
THREE
.
CircleGeometry
=
function
(
a
,
b
,
c
,
d
){
THREE
.
Geometry
.
call
(
this
);
var
a
=
a
||
50
,
c
=
void
0
!==
c
?
c
:
0
,
d
=
void
0
!==
d
?
d
:
2
*
Math
.
PI
,
b
=
void
0
!==
b
?
Math
.
max
(
3
,
b
):
8
,
e
,
f
=
[];
e
=
new
THREE
.
Vector3
;
var
h
=
new
THREE
.
Vector2
(
0.5
,
0.5
);
this
.
vertices
.
push
(
e
);
f
.
push
(
h
);
for
(
e
=
0
;
e
<=
b
;
e
++
){
var
g
=
new
THREE
.
Vector3
,
i
=
c
+
e
/
b
*
d
;
g
.
x
=
a
*
Math
.
cos
(
i
);
g
.
y
=
a
*
Math
.
sin
(
i
);
this
.
vertices
.
push
(
g
);
f
.
push
(
new
THREE
.
Vector2
((
g
.
x
/
a
+
1
)
/
2
,(
g
.
y
/
a
+
1
)
/
2
))}
c
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
for
(
e
=
1
;
e
<=
b
;
e
++
)
this
.
faces
.
push
(
new
THREE
.
Face3
(
e
,
e
+
1
,
0
,[
c
,
c
,
c
])),
this
.
faceVertexUvs
[
0
].
push
([
f
[
e
],
f
[
e
+
1
],
h
]);
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
boundingSphere
=
new
THREE
.
Sphere
(
new
THREE
.
Vector3
,
a
)};
THREE
.
CircleGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
CubeGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
function
h
(
a
,
b
,
c
,
d
,
e
,
f
,
h
,
p
){
var
r
,
s
=
g
.
widthSegments
,
u
=
g
.
heightSegments
,
w
=
e
/
2
,
E
=
f
/
2
,
D
=
g
.
vertices
.
length
;
if
(
"
x
"
===
a
&&
"
y
"
===
b
||
"
y
"
===
a
&&
"
x
"
===
b
)
r
=
"
z
"
;
else
if
(
"
x
"
===
a
&&
"
z
"
===
b
||
"
z
"
===
a
&&
"
x
"
===
b
)
r
=
"
y
"
,
u
=
g
.
depthSegments
;
else
if
(
"
z
"
===
a
&&
"
y
"
===
b
||
"
y
"
===
a
&&
"
z
"
===
b
)
r
=
"
x
"
,
s
=
g
.
depthSegments
;
var
F
=
s
+
1
,
y
=
u
+
1
,
x
=
e
/
s
,
z
=
f
/
u
,
O
=
new
THREE
.
Vector3
;
O
[
r
]
=
0
<
h
?
1
:
-
1
;
for
(
e
=
0
;
e
<
y
;
e
++
)
for
(
f
=
0
;
f
<
F
;
f
++
){
var
B
=
new
THREE
.
Vector3
;
B
[
a
]
=
(
f
*
x
-
w
)
*
c
;
B
[
b
]
=
(
e
*
z
-
E
)
*
d
;
B
[
r
]
=
h
;
g
.
vertices
.
push
(
B
)}
for
(
e
=
0
;
e
<
u
;
e
++
)
for
(
f
=
0
;
f
<
s
;
f
++
)
E
=
f
+
F
*
e
,
a
=
f
+
F
*
(
e
+
1
),
b
=
f
+
1
+
F
*
(
e
+
1
),
c
=
f
+
1
+
F
*
e
,
d
=
new
THREE
.
Vector2
(
f
/
s
,
1
-
e
/
u
),
h
=
new
THREE
.
Vector2
(
f
/
s
,
1
-
(
e
+
1
)
/
u
),
r
=
new
THREE
.
Vector2
((
f
+
1
)
/
s
,
1
-
(
e
+
1
)
/
u
),
w
=
new
THREE
.
Vector2
((
f
+
1
)
/
s
,
1
-
e
/
u
),
E
=
new
THREE
.
Face3
(
E
+
D
,
a
+
D
,
c
+
D
),
E
.
normal
.
copy
(
O
),
E
.
vertexNormals
.
push
(
O
.
clone
(),
O
.
clone
(),
O
.
clone
()),
E
.
materialIndex
=
p
,
g
.
faces
.
push
(
E
),
g
.
faceVertexUvs
[
0
].
push
([
d
,
h
,
w
]),
E
=
new
THREE
.
Face3
(
a
+
D
,
b
+
D
,
c
+
D
),
E
.
normal
.
copy
(
O
),
E
.
vertexNormals
.
push
(
O
.
clone
(),
O
.
clone
(),
O
.
clone
()),
E
.
materialIndex
=
p
,
g
.
faces
.
push
(
E
),
g
.
faceVertexUvs
[
0
].
push
([
h
,
r
,
w
])}
THREE
.
Geometry
.
call
(
this
);
var
g
=
this
;
this
.
width
=
a
;
this
.
height
=
b
;
this
.
depth
=
c
;
this
.
widthSegments
=
d
||
1
;
this
.
heightSegments
=
e
||
1
;
this
.
depthSegments
=
f
||
1
;
a
=
this
.
width
/
2
;
b
=
this
.
height
/
2
;
c
=
this
.
depth
/
2
;
h
(
"
z
"
,
"
y
"
,
-
1
,
-
1
,
this
.
depth
,
this
.
height
,
a
,
0
);
h
(
"
z
"
,
"
y
"
,
1
,
-
1
,
this
.
depth
,
this
.
height
,
-
a
,
1
);
h
(
"
x
"
,
"
z
"
,
1
,
1
,
this
.
width
,
this
.
depth
,
b
,
2
);
h
(
"
x
"
,
"
z
"
,
1
,
-
1
,
this
.
width
,
this
.
depth
,
-
b
,
3
);
h
(
"
x
"
,
"
y
"
,
1
,
-
1
,
this
.
width
,
this
.
height
,
c
,
4
);
h
(
"
x
"
,
"
y
"
,
-
1
,
-
1
,
this
.
width
,
this
.
height
,
-
c
,
5
);
this
.
computeCentroids
();
this
.
mergeVertices
()};
THREE
.
CubeGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
CylinderGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
this
.
radiusTop
=
a
=
void
0
!==
a
?
a
:
20
;
this
.
radiusBottom
=
b
=
void
0
!==
b
?
b
:
20
;
this
.
height
=
c
=
void
0
!==
c
?
c
:
100
;
this
.
radialSegments
=
d
=
d
||
8
;
this
.
heightSegments
=
e
=
e
||
1
;
this
.
openEnded
=
f
=
void
0
!==
f
?
f
:
!
1
;
var
h
=
c
/
2
,
g
,
i
,
k
=
[],
m
=
[];
for
(
i
=
0
;
i
<=
e
;
i
++
){
var
l
=
[],
n
=
[],
t
=
i
/
e
,
q
=
t
*
(
b
-
a
)
+
a
;
for
(
g
=
0
;
g
<=
d
;
g
++
){
var
p
=
g
/
d
,
r
=
new
THREE
.
Vector3
;
r
.
x
=
q
*
Math
.
sin
(
2
*
p
*
Math
.
PI
);
r
.
y
=-
t
*
c
+
h
;
r
.
z
=
q
*
Math
.
cos
(
2
*
p
*
Math
.
PI
);
this
.
vertices
.
push
(
r
);
l
.
push
(
this
.
vertices
.
length
-
1
);
n
.
push
(
new
THREE
.
Vector2
(
p
,
g
.
faceVertexUvs
[
0
].
push
([
h
.
clone
(),
r
,
w
.
clone
()])}
THREE
.
Geometry
.
call
(
this
);
var
g
=
this
;
this
.
width
=
a
;
this
.
height
=
b
;
this
.
depth
=
c
;
this
.
widthSegments
=
d
||
1
;
this
.
heightSegments
=
e
||
1
;
this
.
depthSegments
=
f
||
1
;
a
=
this
.
width
/
2
;
b
=
this
.
height
/
2
;
c
=
this
.
depth
/
2
;
h
(
"
z
"
,
"
y
"
,
-
1
,
-
1
,
this
.
depth
,
this
.
height
,
a
,
0
);
h
(
"
z
"
,
"
y
"
,
1
,
-
1
,
this
.
depth
,
this
.
height
,
-
a
,
1
);
h
(
"
x
"
,
"
z
"
,
1
,
1
,
this
.
width
,
this
.
depth
,
b
,
2
);
h
(
"
x
"
,
"
z
"
,
1
,
-
1
,
this
.
width
,
this
.
depth
,
-
b
,
3
);
h
(
"
x
"
,
"
y
"
,
1
,
-
1
,
this
.
width
,
this
.
height
,
c
,
4
);
h
(
"
x
"
,
"
y
"
,
-
1
,
-
1
,
this
.
width
,
this
.
height
,
-
c
,
5
);
this
.
computeCentroids
();
this
.
mergeVertices
()};
THREE
.
CubeGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
CylinderGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
this
.
radiusTop
=
a
=
void
0
!==
a
?
a
:
20
;
this
.
radiusBottom
=
b
=
void
0
!==
b
?
b
:
20
;
this
.
height
=
c
=
void
0
!==
c
?
c
:
100
;
this
.
radialSegments
=
d
=
d
||
8
;
this
.
heightSegments
=
e
=
e
||
1
;
this
.
openEnded
=
f
=
void
0
!==
f
?
f
:
!
1
;
var
h
=
c
/
2
,
g
,
i
,
k
=
[],
m
=
[];
for
(
i
=
0
;
i
<=
e
;
i
++
){
var
l
=
[],
n
=
[],
t
=
i
/
e
,
q
=
t
*
(
b
-
a
)
+
a
;
for
(
g
=
0
;
g
<=
d
;
g
++
){
var
p
=
g
/
d
,
r
=
new
THREE
.
Vector3
;
r
.
x
=
q
*
Math
.
sin
(
2
*
p
*
Math
.
PI
);
r
.
y
=-
t
*
c
+
h
;
r
.
z
=
q
*
Math
.
cos
(
2
*
p
*
Math
.
PI
);
this
.
vertices
.
push
(
r
);
l
.
push
(
this
.
vertices
.
length
-
1
);
n
.
push
(
new
THREE
.
Vector2
(
p
,
1
-
t
))}
k
.
push
(
l
);
m
.
push
(
n
)}
c
=
(
b
-
a
)
/
c
;
for
(
g
=
0
;
g
<
d
;
g
++
){
0
!==
a
?(
l
=
this
.
vertices
[
k
[
0
][
g
]].
clone
(),
n
=
this
.
vertices
[
k
[
0
][
g
+
1
]].
clone
()):(
l
=
this
.
vertices
[
k
[
1
][
g
]].
clone
(),
n
=
this
.
vertices
[
k
[
1
][
g
+
1
]].
clone
());
l
.
setY
(
Math
.
sqrt
(
l
.
x
*
l
.
x
+
l
.
z
*
l
.
z
)
*
c
).
normalize
();
n
.
setY
(
Math
.
sqrt
(
n
.
x
*
n
.
x
+
n
.
z
*
n
.
z
)
*
c
).
normalize
();
for
(
i
=
0
;
i
<
e
;
i
++
){
var
t
=
k
[
i
][
g
],
q
=
k
[
i
+
1
][
g
],
p
=
k
[
i
+
1
][
g
+
1
],
r
=
k
[
i
][
g
+
1
],
s
=
l
.
clone
(),
u
=
l
.
clone
(),
w
=
n
.
clone
(),
E
=
n
.
clone
(),
D
=
m
[
i
][
g
].
clone
(),
F
=
m
[
i
+
1
][
g
].
clone
(),
y
=
m
[
i
+
1
][
g
+
1
].
clone
(),
x
=
m
[
i
][
g
+
1
].
clone
();
this
.
faces
.
push
(
new
THREE
.
Face3
(
t
,
q
,
r
,[
s
,
u
,
E
]));
this
.
faceVertexUvs
[
0
].
push
([
D
,
F
,
x
]);
this
.
faces
.
push
(
new
THREE
.
Face3
(
q
,
p
,
r
,[
u
,
w
,
E
]));
this
.
faceVertexUvs
[
0
].
push
([
F
,
y
,
x
])}}
if
(
!
1
===
f
&&
0
<
a
){
this
.
vertices
.
push
(
new
THREE
.
Vector3
(
0
,
h
,
0
));
for
(
g
=
0
;
g
<
d
;
g
++
)
t
=
k
[
0
][
g
],
q
=
k
[
0
][
g
+
1
],
p
=
this
.
vertices
.
length
-
1
,
s
=
new
THREE
.
Vector3
(
0
,
1
,
0
),
u
=
new
THREE
.
Vector3
(
0
,
1
,
0
),
w
=
new
THREE
.
Vector3
(
0
,
1
,
0
),
D
=
m
[
0
][
g
].
clone
(),
F
=
m
[
0
][
g
+
1
].
clone
(),
y
=
new
THREE
.
Vector2
(
F
.
u
,
0
),
this
.
faces
.
push
(
new
THREE
.
Face3
(
t
,
q
,
p
,[
s
,
u
,
w
])),
this
.
faceVertexUvs
[
0
].
push
([
D
,
F
,
y
])}
if
(
!
1
===
f
&&
0
<
b
){
this
.
vertices
.
push
(
new
THREE
.
Vector3
(
0
,
-
h
,
0
));
for
(
g
=
0
;
g
<
d
;
g
++
)
t
=
k
[
i
][
g
+
1
],
q
=
k
[
i
][
g
],
p
=
this
.
vertices
.
length
-
1
,
s
=
new
THREE
.
Vector3
(
0
,
-
1
,
0
),
u
=
new
THREE
.
Vector3
(
0
,
-
1
,
0
),
w
=
new
THREE
.
Vector3
(
0
,
-
1
,
0
),
D
=
m
[
i
][
g
+
1
].
clone
(),
F
=
m
[
i
][
g
].
clone
(),
y
=
new
THREE
.
Vector2
(
F
.
u
,
1
),
this
.
faces
.
push
(
new
THREE
.
Face3
(
t
,
q
,
p
,[
s
,
u
,
w
])),
this
.
faceVertexUvs
[
0
].
push
([
D
,
F
,
y
])}
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
CylinderGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ExtrudeGeometry
=
function
(
a
,
b
){
"
undefined
"
!==
typeof
a
&&
(
THREE
.
Geometry
.
call
(
this
),
a
=
a
instanceof
Array
?
a
:[
a
],
this
.
shapebb
=
a
[
a
.
length
-
1
].
getBoundingBox
(),
this
.
addShapeList
(
a
,
b
),
this
.
computeCentroids
(),
this
.
computeFaceNormals
())};
THREE
.
ExtrudeGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ExtrudeGeometry
.
prototype
.
addShapeList
=
function
(
a
,
b
){
for
(
var
c
=
a
.
length
,
d
=
0
;
d
<
c
;
d
++
)
this
.
addShape
(
a
[
d
],
b
)};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录