Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
36f66b7f
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,发现更多精彩内容 >>
提交
36f66b7f
编写于
3月 15, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
10543ca3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
build/three.js
build/three.js
+9
-9
build/three.min.js
build/three.min.js
+2
-2
未找到文件。
build/three.js
浏览文件 @
36f66b7f
...
...
@@ -2909,16 +2909,16 @@ THREE.Vector4.prototype = {
* @author mrdoob / http://mrdoob.com/
*/
THREE.
Typed
Vector2 = function ( array, offset ) {
THREE.
Proxy
Vector2 = function ( array, offset ) {
this.array = array;
this.offset = offset;
};
THREE.
Typed
Vector2.prototype = Object.create( THREE.Vector2.prototype );
THREE.
Proxy
Vector2.prototype = Object.create( THREE.Vector2.prototype );
Object.defineProperties( THREE.
Typed
Vector2.prototype, {
Object.defineProperties( THREE.
Proxy
Vector2.prototype, {
'x': {
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
...
...
@@ -2932,16 +2932,16 @@ Object.defineProperties( THREE.TypedVector2.prototype, {
* @author mrdoob / http://mrdoob.com/
*/
THREE.
Typed
Vector3 = function ( array, offset ) {
THREE.
Proxy
Vector3 = function ( array, offset ) {
this.array = array;
this.offset = offset;
};
THREE.
Typed
Vector3.prototype = Object.create( THREE.Vector3.prototype );
THREE.
Proxy
Vector3.prototype = Object.create( THREE.Vector3.prototype );
Object.defineProperties( THREE.
Typed
Vector3.prototype, {
Object.defineProperties( THREE.
Proxy
Vector3.prototype, {
'x': {
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
...
...
@@ -9995,9 +9995,9 @@ THREE.BufferGeometryManipulator = function ( bufferGeometry ) {
for ( var i = 0; i < length; i ++ ) {
this.vertices.push( new THREE.
Typed
Vector3( attributes.position.array, i * 3 ) );
this.normals.push( new THREE.
Typed
Vector3( attributes.normal.array, i * 3 ) );
this.uvs.push( new THREE.
Typed
Vector2( attributes.uv.array, i * 2 ) );
this.vertices.push( new THREE.
Proxy
Vector3( attributes.position.array, i * 3 ) );
this.normals.push( new THREE.
Proxy
Vector3( attributes.normal.array, i * 3 ) );
this.uvs.push( new THREE.
Proxy
Vector2( attributes.uv.array, i * 2 ) );
}
...
...
build/three.min.js
浏览文件 @
36f66b7f
...
...
@@ -59,7 +59,7 @@ a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);return this},clamp:functi
Math
.
floor
(
this
.
y
);
this
.
z
=
Math
.
floor
(
this
.
z
);
this
.
w
=
Math
.
floor
(
this
.
w
);
return
this
},
ceil
:
function
(){
this
.
x
=
Math
.
ceil
(
this
.
x
);
this
.
y
=
Math
.
ceil
(
this
.
y
);
this
.
z
=
Math
.
ceil
(
this
.
z
);
this
.
w
=
Math
.
ceil
(
this
.
w
);
return
this
},
round
:
function
(){
this
.
x
=
Math
.
round
(
this
.
x
);
this
.
y
=
Math
.
round
(
this
.
y
);
this
.
z
=
Math
.
round
(
this
.
z
);
this
.
w
=
Math
.
round
(
this
.
w
);
return
this
},
roundToZero
:
function
(){
this
.
x
=
0
>
this
.
x
?
Math
.
ceil
(
this
.
x
):
Math
.
floor
(
this
.
x
);
this
.
y
=
0
>
this
.
y
?
Math
.
ceil
(
this
.
y
):
Math
.
floor
(
this
.
y
);
this
.
z
=
0
>
this
.
z
?
Math
.
ceil
(
this
.
z
):
Math
.
floor
(
this
.
z
);
this
.
w
=
0
>
this
.
w
?
Math
.
ceil
(
this
.
w
):
Math
.
floor
(
this
.
w
);
return
this
},
negate
:
function
(){
return
this
.
multiplyScalar
(
-
1
)},
dot
:
function
(
a
){
return
this
.
x
*
a
.
x
+
this
.
y
*
a
.
y
+
this
.
z
*
a
.
z
+
this
.
w
*
a
.
w
},
lengthSq
:
function
(){
return
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
lengthManhattan
:
function
(){
return
Math
.
abs
(
this
.
x
)
+
Math
.
abs
(
this
.
y
)
+
Math
.
abs
(
this
.
z
)
+
Math
.
abs
(
this
.
w
)},
normalize
:
function
(){
return
this
.
divideScalar
(
this
.
length
())},
setLength
:
function
(
a
){
var
b
=
this
.
length
();
0
!==
b
&&
a
!==
b
&&
this
.
multiplyScalar
(
a
/
b
);
return
this
},
lerp
:
function
(
a
,
b
){
this
.
x
+=
(
a
.
x
-
this
.
x
)
*
b
;
this
.
y
+=
(
a
.
y
-
this
.
y
)
*
b
;
this
.
z
+=
(
a
.
z
-
this
.
z
)
*
b
;
this
.
w
+=
(
a
.
w
-
this
.
w
)
*
b
;
return
this
},
equals
:
function
(
a
){
return
a
.
x
===
this
.
x
&&
a
.
y
===
this
.
y
&&
a
.
z
===
this
.
z
&&
a
.
w
===
this
.
w
},
fromArray
:
function
(
a
){
this
.
x
=
a
[
0
];
this
.
y
=
a
[
1
];
this
.
z
=
a
[
2
];
this
.
w
=
a
[
3
];
return
this
},
toArray
:
function
(){
return
[
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
]},
clone
:
function
(){
return
new
THREE
.
Vector4
(
this
.
x
,
this
.
y
,
this
.
z
,
this
.
w
)}};
THREE
.
TypedVector2
=
function
(
a
,
b
){
this
.
array
=
a
;
this
.
offset
=
b
};
THREE
.
TypedVector2
.
prototype
=
Object
.
create
(
THREE
.
Vector2
.
prototype
);
Object
.
defineProperties
(
THREE
.
TypedVector2
.
prototype
,{
x
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
]
=
a
}},
y
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
1
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
1
]
=
a
}}});
THREE
.
TypedVector3
=
function
(
a
,
b
){
this
.
array
=
a
;
this
.
offset
=
b
};
THREE
.
TypedVector3
.
prototype
=
Object
.
create
(
THREE
.
Vector3
.
prototype
);
Object
.
defineProperties
(
THREE
.
Typed
Vector3
.
prototype
,{
x
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
]
=
a
}},
y
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
1
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
1
]
=
a
}},
z
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
2
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
2
]
=
a
}}});
THREE
.
Euler
=
function
(
a
,
b
,
c
,
d
){
this
.
_x
=
a
||
0
;
this
.
_y
=
b
||
0
;
this
.
_z
=
c
||
0
;
this
.
_order
=
d
||
THREE
.
Euler
.
DefaultOrder
};
THREE
.
Euler
.
RotationOrders
=
"
XYZ YZX ZXY XZY YXZ ZYX
"
.
split
(
"
"
);
THREE
.
Euler
.
DefaultOrder
=
"
XYZ
"
;
this
.
w
)}};
THREE
.
ProxyVector2
=
function
(
a
,
b
){
this
.
array
=
a
;
this
.
offset
=
b
};
THREE
.
ProxyVector2
.
prototype
=
Object
.
create
(
THREE
.
Vector2
.
prototype
);
Object
.
defineProperties
(
THREE
.
ProxyVector2
.
prototype
,{
x
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
]
=
a
}},
y
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
1
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
1
]
=
a
}}});
THREE
.
ProxyVector3
=
function
(
a
,
b
){
this
.
array
=
a
;
this
.
offset
=
b
};
THREE
.
ProxyVector3
.
prototype
=
Object
.
create
(
THREE
.
Vector3
.
prototype
);
Object
.
defineProperties
(
THREE
.
Proxy
Vector3
.
prototype
,{
x
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
]
=
a
}},
y
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
1
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
1
]
=
a
}},
z
:{
get
:
function
(){
return
this
.
array
[
this
.
offset
+
2
]},
set
:
function
(
a
){
this
.
array
[
this
.
offset
+
2
]
=
a
}}});
THREE
.
Euler
=
function
(
a
,
b
,
c
,
d
){
this
.
_x
=
a
||
0
;
this
.
_y
=
b
||
0
;
this
.
_z
=
c
||
0
;
this
.
_order
=
d
||
THREE
.
Euler
.
DefaultOrder
};
THREE
.
Euler
.
RotationOrders
=
"
XYZ YZX ZXY XZY YXZ ZYX
"
.
split
(
"
"
);
THREE
.
Euler
.
DefaultOrder
=
"
XYZ
"
;
THREE
.
Euler
.
prototype
=
{
constructor
:
THREE
.
Euler
,
_x
:
0
,
_y
:
0
,
_z
:
0
,
_order
:
THREE
.
Euler
.
DefaultOrder
,
_quaternion
:
void
0
,
_updateQuaternion
:
function
(){
void
0
!==
this
.
_quaternion
&&
this
.
_quaternion
.
setFromEuler
(
this
,
!
1
)},
get
x
(){
return
this
.
_x
},
set
x
(
a
){
this
.
_x
=
a
;
this
.
_updateQuaternion
()},
get
y
(){
return
this
.
_y
},
set
y
(
a
){
this
.
_y
=
a
;
this
.
_updateQuaternion
()},
get
z
(){
return
this
.
_z
},
set
z
(
a
){
this
.
_z
=
a
;
this
.
_updateQuaternion
()},
get
order
(){
return
this
.
_order
},
set
order
(
a
){
this
.
_order
=
a
;
this
.
_updateQuaternion
()},
set
:
function
(
a
,
b
,
c
,
d
){
this
.
_x
=
a
;
this
.
_y
=
b
;
this
.
_z
=
c
;
this
.
_order
=
d
||
this
.
_order
;
this
.
_updateQuaternion
();
return
this
},
copy
:
function
(
a
){
this
.
_x
=
a
.
_x
;
this
.
_y
=
a
.
_y
;
this
.
_z
=
a
.
_z
;
this
.
_order
=
a
.
_order
;
this
.
_updateQuaternion
();
return
this
},
setFromRotationMatrix
:
function
(
a
,
b
){
var
c
=
THREE
.
Math
.
clamp
,
d
=
a
.
elements
,
e
=
d
[
0
],
f
=
d
[
4
],
g
=
d
[
8
],
h
=
d
[
1
],
k
=
d
[
5
],
l
=
d
[
9
],
n
=
d
[
2
],
r
=
d
[
6
],
d
=
d
[
10
];
b
=
b
||
this
.
_order
;
"
XYZ
"
===
b
?(
this
.
_y
=
Math
.
asin
(
c
(
g
,
-
1
,
1
)),
0.99999
>
Math
.
abs
(
g
)?(
this
.
_x
=
Math
.
atan2
(
-
l
,
d
),
this
.
_z
=
Math
.
atan2
(
-
f
,
e
)):(
this
.
_x
=
Math
.
atan2
(
r
,
k
),
this
.
_z
=
0
)):
"
YXZ
"
===
b
?(
this
.
_x
=
Math
.
asin
(
-
c
(
l
,
-
1
,
1
)),
0.99999
>
Math
.
abs
(
l
)?(
this
.
_y
=
Math
.
atan2
(
g
,
d
),
this
.
_z
=
Math
.
atan2
(
h
,
k
)):(
this
.
_y
=
Math
.
atan2
(
-
n
,
e
),
this
.
_z
=
0
)):
"
ZXY
"
===
b
?(
this
.
_x
=
Math
.
asin
(
c
(
r
,
-
1
,
1
)),
0.99999
>
Math
.
abs
(
r
)?(
this
.
_y
=
Math
.
atan2
(
-
n
,
d
),
this
.
_z
=
Math
.
atan2
(
-
f
,
k
)):(
this
.
_y
=
0
,
this
.
_z
=
Math
.
atan2
(
h
,
e
))):
"
ZYX
"
===
b
?(
this
.
_y
=
Math
.
asin
(
-
c
(
n
,
-
1
,
1
)),
0.99999
>
Math
.
abs
(
n
)?(
this
.
_x
=
Math
.
atan2
(
r
,
d
),
this
.
_z
=
Math
.
atan2
(
h
,
e
)):(
this
.
_x
=
0
,
this
.
_z
=
Math
.
atan2
(
-
f
,
k
))):
"
YZX
"
===
b
?(
this
.
_z
=
Math
.
asin
(
c
(
h
,
...
...
@@ -200,7 +200,7 @@ P[n].start;da=P[n].count;var ga=P[n].index,g=R;for(R+=da;g<R;g+=3)da=ga+c[g],V=g
3
,
e
=
new
Uint16Array
(
a
.
length
),
f
=
0
,
g
=
0
,
h
=
[{
start
:
0
,
count
:
0
,
index
:
0
}],
k
=
h
[
0
],
l
=
0
,
n
=
0
,
r
=
new
Int32Array
(
6
),
p
=
new
Int32Array
(
c
.
length
),
s
=
new
Int32Array
(
c
.
length
),
u
=
0
;
u
<
c
.
length
;
u
++
)
p
[
u
]
=-
1
,
s
[
u
]
=-
1
;
for
(
c
=
0
;
c
<
d
;
c
++
){
for
(
var
q
=
n
=
0
;
3
>
q
;
q
++
)
u
=
a
[
3
*
c
+
q
],
-
1
==
p
[
u
]?(
r
[
2
*
q
]
=
u
,
r
[
2
*
q
+
1
]
=-
1
,
n
++
):
p
[
u
]
<
k
.
index
?(
r
[
2
*
q
]
=
u
,
r
[
2
*
q
+
1
]
=-
1
,
l
++
):(
r
[
2
*
q
]
=
u
,
r
[
2
*
q
+
1
]
=
p
[
u
]);
if
(
g
+
n
>
k
.
index
+
b
)
for
(
k
=
{
start
:
f
,
count
:
0
,
index
:
g
},
h
.
push
(
k
),
n
=
0
;
6
>
n
;
n
+=
2
)
q
=
r
[
n
+
1
],
-
1
<
q
&&
q
<
k
.
index
&&
(
r
[
n
+
1
]
=-
1
);
for
(
n
=
0
;
6
>
n
;
n
+=
2
)
u
=
r
[
n
],
q
=
r
[
n
+
1
],
-
1
===
q
&&
(
q
=
g
++
),
p
[
u
]
=
q
,
s
[
q
]
=
u
,
e
[
f
++
]
=
q
-
k
.
index
,
k
.
count
++
}
this
.
reorderBuffers
(
e
,
s
,
g
);
return
this
.
offsets
=
h
},
reorderBuffers
:
function
(
a
,
b
,
c
){
var
d
=
{},
e
=
[
Int8Array
,
Uint8Array
,
Uint8ClampedArray
,
Int16Array
,
Uint16Array
,
Int32Array
,
Uint32Array
,
Float32Array
,
Float64Array
],
f
;
for
(
f
in
this
.
attributes
)
if
(
"
index
"
!=
f
)
for
(
var
g
=
this
.
attributes
[
f
].
array
,
h
=
0
,
k
=
e
.
length
;
h
<
k
;
h
++
){
var
l
=
e
[
h
];
if
(
g
instanceof
l
){
d
[
f
]
=
new
l
(
this
.
attributes
[
f
].
itemSize
*
c
);
break
}}
for
(
e
=
0
;
e
<
c
;
e
++
)
for
(
f
in
g
=
b
[
e
],
this
.
attributes
)
if
(
"
index
"
!=
f
)
for
(
var
h
=
this
.
attributes
[
f
].
array
,
k
=
this
.
attributes
[
f
].
itemSize
,
l
=
d
[
f
],
n
=
0
;
n
<
k
;
n
++
)
l
[
e
*
k
+
n
]
=
h
[
g
*
k
+
n
];
this
.
attributes
.
index
.
array
=
a
;
for
(
f
in
this
.
attributes
)
"
index
"
!=
f
&&
(
this
.
attributes
[
f
].
array
=
d
[
f
],
this
.
attributes
[
f
].
numItems
=
this
.
attributes
[
f
].
itemSize
*
c
)},
clone
:
function
(){
var
a
=
new
THREE
.
BufferGeometry
,
b
=
[
Int8Array
,
Uint8Array
,
Uint8ClampedArray
,
Int16Array
,
Uint16Array
,
Int32Array
,
Uint32Array
,
Float32Array
,
Float64Array
],
c
;
for
(
c
in
this
.
attributes
){
for
(
var
d
=
this
.
attributes
[
c
],
e
=
d
.
array
,
f
=
{
itemSize
:
d
.
itemSize
,
array
:
null
},
d
=
0
,
g
=
b
.
length
;
d
<
g
;
d
++
){
var
h
=
b
[
d
];
if
(
e
instanceof
h
){
f
.
array
=
new
h
(
e
);
break
}}
a
.
attributes
[
c
]
=
f
}
d
=
0
;
for
(
g
=
this
.
offsets
.
length
;
d
<
g
;
d
++
)
b
=
this
.
offsets
[
d
],
a
.
offsets
.
push
({
start
:
b
.
start
,
index
:
b
.
index
,
count
:
b
.
count
});
return
a
},
dispose
:
function
(){
this
.
dispatchEvent
({
type
:
"
dispose
"
})}};
THREE
.
EventDispatcher
.
prototype
.
apply
(
THREE
.
BufferGeometry
.
prototype
);
THREE
.
BufferGeometryManipulator
=
function
(
a
){
this
.
vertices
=
[];
this
.
normals
=
[];
this
.
uvs
=
[];
a
=
a
.
attributes
;
for
(
var
b
=
a
.
position
.
array
.
length
/
3
,
c
=
0
;
c
<
b
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
TypedVector3
(
a
.
position
.
array
,
3
*
c
)),
this
.
normals
.
push
(
new
THREE
.
TypedVector3
(
a
.
normal
.
array
,
3
*
c
)),
this
.
uvs
.
push
(
new
THREE
.
Typed
Vector2
(
a
.
uv
.
array
,
2
*
c
))};
THREE
.
Geometry
=
function
(){
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
""
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
morphNormals
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
lineDistances
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
;
this
.
dynamic
=!
0
;
this
.
buffersNeedUpdate
=
this
.
lineDistancesNeedUpdate
=
this
.
colorsNeedUpdate
=
this
.
tangentsNeedUpdate
=
this
.
normalsNeedUpdate
=
this
.
uvsNeedUpdate
=
g
;
d
++
){
var
h
=
b
[
d
];
if
(
e
instanceof
h
){
f
.
array
=
new
h
(
e
);
break
}}
a
.
attributes
[
c
]
=
f
}
d
=
0
;
for
(
g
=
this
.
offsets
.
length
;
d
<
g
;
d
++
)
b
=
this
.
offsets
[
d
],
a
.
offsets
.
push
({
start
:
b
.
start
,
index
:
b
.
index
,
count
:
b
.
count
});
return
a
},
dispose
:
function
(){
this
.
dispatchEvent
({
type
:
"
dispose
"
})}};
THREE
.
EventDispatcher
.
prototype
.
apply
(
THREE
.
BufferGeometry
.
prototype
);
THREE
.
BufferGeometryManipulator
=
function
(
a
){
this
.
vertices
=
[];
this
.
normals
=
[];
this
.
uvs
=
[];
a
=
a
.
attributes
;
for
(
var
b
=
a
.
position
.
array
.
length
/
3
,
c
=
0
;
c
<
b
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
ProxyVector3
(
a
.
position
.
array
,
3
*
c
)),
this
.
normals
.
push
(
new
THREE
.
ProxyVector3
(
a
.
normal
.
array
,
3
*
c
)),
this
.
uvs
.
push
(
new
THREE
.
Proxy
Vector2
(
a
.
uv
.
array
,
2
*
c
))};
THREE
.
Geometry
=
function
(){
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
""
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
morphNormals
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
lineDistances
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
;
this
.
dynamic
=!
0
;
this
.
buffersNeedUpdate
=
this
.
lineDistancesNeedUpdate
=
this
.
colorsNeedUpdate
=
this
.
tangentsNeedUpdate
=
this
.
normalsNeedUpdate
=
this
.
uvsNeedUpdate
=
this
.
elementsNeedUpdate
=
this
.
verticesNeedUpdate
=!
1
};
THREE
.
Geometry
.
prototype
=
{
constructor
:
THREE
.
Geometry
,
applyMatrix
:
function
(
a
){
for
(
var
b
=
(
new
THREE
.
Matrix3
).
getNormalMatrix
(
a
),
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
)
this
.
vertices
[
c
].
applyMatrix4
(
a
);
c
=
0
;
for
(
d
=
this
.
faces
.
length
;
c
<
d
;
c
++
){
a
=
this
.
faces
[
c
];
a
.
normal
.
applyMatrix3
(
b
).
normalize
();
for
(
var
e
=
0
,
f
=
a
.
vertexNormals
.
length
;
e
<
f
;
e
++
)
a
.
vertexNormals
[
e
].
applyMatrix3
(
b
).
normalize
()}
this
.
boundingBox
instanceof
THREE
.
Box3
&&
this
.
computeBoundingBox
();
this
.
boundingSphere
instanceof
THREE
.
Sphere
&&
this
.
computeBoundingSphere
()},
computeFaceNormals
:
function
(){
for
(
var
a
=
new
THREE
.
Vector3
,
b
=
new
THREE
.
Vector3
,
c
=
0
,
d
=
this
.
faces
.
length
;
c
<
d
;
c
++
){
var
e
=
this
.
faces
[
c
],
f
=
this
.
vertices
[
e
.
a
],
g
=
this
.
vertices
[
e
.
b
];
a
.
subVectors
(
this
.
vertices
[
e
.
c
],
g
);
b
.
subVectors
(
f
,
g
);
a
.
cross
(
b
);
a
.
normalize
();
e
.
normal
.
copy
(
a
)}},
computeVertexNormals
:
function
(
a
){
var
b
,
c
,
d
;
d
=
Array
(
this
.
vertices
.
length
);
b
=
0
;
for
(
c
=
this
.
vertices
.
length
;
b
<
c
;
b
++
)
d
[
b
]
=
new
THREE
.
Vector3
;
if
(
a
){
var
e
,
f
,
g
,
h
=
new
THREE
.
Vector3
,
k
=
new
THREE
.
Vector3
;
new
THREE
.
Vector3
;
new
THREE
.
Vector3
;
new
THREE
.
Vector3
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录