Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
803f4577
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
803f4577
编写于
4月 16, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved UTF8Loader to /examples/js/loaders and start to setup the idea from #1613.
上级
38c5643d
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
536 addition
and
546 deletion
+536
-546
build/Three.js
build/Three.js
+406
-411
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+2
-2
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+116
-122
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+2
-2
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+2
-1
examples/js/loaders/UTF8Loader.js
examples/js/loaders/UTF8Loader.js
+0
-0
examples/js/loaders/ctm/CTMLoader.js
examples/js/loaders/ctm/CTMLoader.js
+1
-1
examples/js/loaders/ctm/CTMWorker.js
examples/js/loaders/ctm/CTMWorker.js
+0
-0
examples/js/loaders/ctm/ctm.js
examples/js/loaders/ctm/ctm.js
+0
-0
examples/js/loaders/ctm/license/OpenCTM.txt
examples/js/loaders/ctm/license/OpenCTM.txt
+0
-0
examples/js/loaders/ctm/license/js-lzma.txt
examples/js/loaders/ctm/license/js-lzma.txt
+0
-0
examples/js/loaders/ctm/license/js-openctm.txt
examples/js/loaders/ctm/license/js-openctm.txt
+0
-0
examples/js/loaders/ctm/lzma.js
examples/js/loaders/ctm/lzma.js
+0
-0
examples/webgl_loader_ctm.html
examples/webgl_loader_ctm.html
+3
-3
examples/webgl_loader_ctm_materials.html
examples/webgl_loader_ctm_materials.html
+3
-3
examples/webgl_loader_utf8.html
examples/webgl_loader_utf8.html
+1
-0
utils/build.py
utils/build.py
+0
-1
未找到文件。
build/Three.js
浏览文件 @
803f4577
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
803f4577
...
...
@@ -98,8 +98,8 @@ j=a.vertices[d];i=g[e];m=g[f];n=g[C];o=k.x-h.x;p=j.x-h.x;l=k.y-h.y;r=j.y-h.y;u=k
this
.
vertices
.
length
;
b
<
c
;
b
++
){
s
[
b
]
=
new
THREE
.
Vector3
;
w
[
b
]
=
new
THREE
.
Vector3
}
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
f
=
this
.
faces
[
b
];
g
=
this
.
faceVertexUvs
[
0
][
b
];
if
(
f
instanceof
THREE
.
Face3
)
a
(
this
,
f
.
a
,
f
.
b
,
f
.
c
,
0
,
1
,
2
);
else
if
(
f
instanceof
THREE
.
Face4
){
a
(
this
,
f
.
a
,
f
.
b
,
f
.
d
,
0
,
1
,
3
);
a
(
this
,
f
.
b
,
f
.
c
,
f
.
d
,
1
,
2
,
3
)}}
var
Q
=
[
"
a
"
,
"
b
"
,
"
c
"
,
"
d
"
];
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
f
=
this
.
faces
[
b
];
for
(
d
=
0
;
d
<
f
.
vertexNormals
.
length
;
d
++
){
O
.
copy
(
f
.
vertexNormals
[
d
]);
e
=
f
[
Q
[
d
]];
G
=
s
[
e
];
$
.
copy
(
G
);
$
.
subSelf
(
O
.
multiplyScalar
(
O
.
dot
(
G
))).
normalize
();
da
.
cross
(
f
.
vertexNormals
[
d
],
G
);
e
=
da
.
dot
(
w
[
e
]);
e
=
e
<
0
?
-
1
:
1
;
f
.
vertexTangents
[
d
]
=
new
THREE
.
Vector4
(
$
.
x
,
$
.
y
,
$
.
z
,
e
)}}
this
.
hasTangents
=
true
},
computeBoundingBox
:
function
(){
if
(
!
this
.
boundingBox
)
this
.
boundingBox
=
{
min
:
new
THREE
.
Vector3
,
max
:
new
THREE
.
Vector3
};
if
(
this
.
vertices
.
length
>
0
){
var
a
;
a
=
this
.
vertices
[
0
];
this
.
boundingBox
.
min
.
copy
(
a
);
this
.
boundingBox
.
max
.
copy
(
a
);
for
(
var
b
=
this
.
boundingBox
.
min
,
c
=
this
.
boundingBox
.
max
,
d
=
1
,
e
=
this
.
vertices
.
length
;
d
<
e
;
d
++
){
a
=
this
.
vertices
[
d
];
if
(
a
.
x
<
b
.
x
)
b
.
x
=
a
.
x
;
else
if
(
a
.
x
>
c
.
x
)
c
.
x
=
a
.
x
;
if
(
a
.
y
<
b
.
y
)
b
.
y
=
a
.
y
;
else
if
(
a
.
y
>
c
.
y
)
c
.
y
=
a
.
y
;
if
(
a
.
z
<
b
.
z
)
b
.
z
=
a
.
z
;
else
if
(
a
.
z
>
c
.
z
)
c
.
z
=
a
.
z
}}
else
{
this
.
boundingBox
.
min
.
set
(
0
,
0
,
0
);
this
.
boundingBox
.
max
.
set
(
0
,
0
,
0
)}},
computeBoundingSphere
:
function
(){
if
(
!
this
.
boundingSphere
)
this
.
boundingSphere
=
{
radius
:
0
};
for
(
var
a
,
b
=
0
,
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
){
a
=
this
.
vertices
[
c
].
length
();
a
>
b
&&
(
b
=
a
)}
this
.
boundingSphere
.
radius
=
b
},
mergeVertices
:
function
(){
var
a
=
{},
b
=
[],
c
=
[],
d
,
e
=
Math
.
pow
(
10
,
4
),
f
,
g
;
f
=
0
;
for
(
g
=
this
.
vertices
.
length
;
f
<
g
;
f
++
){
d
=
this
.
vertices
[
f
];
d
=
[
Math
.
round
(
d
.
x
*
e
),
Math
.
round
(
d
.
y
*
e
),
Math
.
round
(
d
.
z
*
e
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
f
;
b
.
push
(
this
.
vertices
[
f
]);
c
[
f
]
=
b
.
length
-
1
}
else
c
[
f
]
=
c
[
a
[
d
]]}
f
=
0
;
for
(
g
=
this
.
faces
.
length
;
f
<
g
;
f
++
){
a
=
this
.
faces
[
f
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
]
}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
THREE
.
Camera
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
new
THREE
.
Matrix4
;
this
.
projectionMatrixInverse
=
new
THREE
.
Matrix4
};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
THREE
.
Camera
.
prototype
.
lookAt
=
function
(
a
){
this
.
matrix
.
lookAt
(
this
.
position
,
a
,
this
.
up
);
this
.
rotationAutoUpdate
&&
this
.
rotation
.
getRotationFromMatrix
(
this
.
matrix
)};
e
),
Math
.
round
(
d
.
y
*
e
),
Math
.
round
(
d
.
z
*
e
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
f
;
b
.
push
(
this
.
vertices
[
f
]);
c
[
f
]
=
b
.
length
-
1
}
else
c
[
f
]
=
c
[
a
[
d
]]}
f
=
0
;
for
(
g
=
this
.
faces
.
length
;
f
<
g
;
f
++
){
a
=
this
.
faces
[
f
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
]
;
e
=
[
a
.
a
,
a
.
b
,
a
.
c
,
a
.
d
];
for
(
d
=
3
;
d
>
0
;
d
--
)
if
(
e
.
indexOf
(
a
[
"
abcd
"
[
d
]])
!=
d
){
e
.
splice
(
d
,
1
);
this
.
faces
[
f
]
=
new
THREE
.
Face3
(
e
[
0
],
e
[
1
],
e
[
2
]);
this
.
faceVertexUvs
[
0
][
f
].
splice
(
d
,
1
)}}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
THREE
.
Camera
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
new
THREE
.
Matrix4
;
this
.
projectionMatrixInverse
=
new
THREE
.
Matrix4
};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
THREE
.
Camera
.
prototype
.
lookAt
=
function
(
a
){
this
.
matrix
.
lookAt
(
this
.
position
,
a
,
this
.
up
);
this
.
rotationAutoUpdate
&&
this
.
rotation
.
getRotationFromMatrix
(
this
.
matrix
)};
THREE
.
OrthographicCamera
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Camera
.
call
(
this
);
this
.
left
=
a
;
this
.
right
=
b
;
this
.
top
=
c
;
this
.
bottom
=
d
;
this
.
near
=
e
!==
void
0
?
e
:
0.1
;
this
.
far
=
f
!==
void
0
?
f
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
OrthographicCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
OrthographicCamera
.
prototype
.
constructor
=
THREE
.
OrthographicCamera
;
THREE
.
OrthographicCamera
.
prototype
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
.
makeOrthographic
(
this
.
left
,
this
.
right
,
this
.
top
,
this
.
bottom
,
this
.
near
,
this
.
far
)};
THREE
.
PerspectiveCamera
=
function
(
a
,
b
,
c
,
d
){
THREE
.
Camera
.
call
(
this
);
this
.
fov
=
a
!==
void
0
?
a
:
50
;
this
.
aspect
=
b
!==
void
0
?
b
:
1
;
this
.
near
=
c
!==
void
0
?
c
:
0.1
;
this
.
far
=
d
!==
void
0
?
d
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
PerspectiveCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PerspectiveCamera
.
prototype
.
constructor
=
THREE
.
PerspectiveCamera
;
THREE
.
PerspectiveCamera
.
prototype
.
setLens
=
function
(
a
,
b
){
this
.
fov
=
2
*
Math
.
atan
((
b
!==
void
0
?
b
:
24
)
/
(
a
*
2
))
*
(
180
/
Math
.
PI
);
this
.
updateProjectionMatrix
()};
THREE
.
PerspectiveCamera
.
prototype
.
setViewOffset
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
fullWidth
=
a
;
this
.
fullHeight
=
b
;
this
.
x
=
c
;
this
.
y
=
d
;
this
.
width
=
e
;
this
.
height
=
f
;
this
.
updateProjectionMatrix
()};
...
...
build/custom/ThreeExtras.js
浏览文件 @
803f4577
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
803f4577
...
...
@@ -98,8 +98,8 @@ k=a.vertices[d];h=g[e];m=g[f];n=g[w];l=j.x-i.x;o=k.x-i.x;p=j.y-i.y;r=k.y-i.y;x=j
this
.
vertices
.
length
;
b
<
c
;
b
++
){
F
[
b
]
=
new
THREE
.
Vector3
;
C
[
b
]
=
new
THREE
.
Vector3
}
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
f
=
this
.
faces
[
b
];
g
=
this
.
faceVertexUvs
[
0
][
b
];
if
(
f
instanceof
THREE
.
Face3
)
a
(
this
,
f
.
a
,
f
.
b
,
f
.
c
,
0
,
1
,
2
);
else
if
(
f
instanceof
THREE
.
Face4
){
a
(
this
,
f
.
a
,
f
.
b
,
f
.
d
,
0
,
1
,
3
);
a
(
this
,
f
.
b
,
f
.
c
,
f
.
d
,
1
,
2
,
3
)}}
var
R
=
[
"
a
"
,
"
b
"
,
"
c
"
,
"
d
"
];
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
f
=
this
.
faces
[
b
];
for
(
d
=
0
;
d
<
f
.
vertexNormals
.
length
;
d
++
){
M
.
copy
(
f
.
vertexNormals
[
d
]);
e
=
f
[
R
[
d
]];
A
=
F
[
e
];
L
.
copy
(
A
);
L
.
subSelf
(
M
.
multiplyScalar
(
M
.
dot
(
A
))).
normalize
();
P
.
cross
(
f
.
vertexNormals
[
d
],
A
);
e
=
P
.
dot
(
C
[
e
]);
e
=
e
<
0
?
-
1
:
1
;
f
.
vertexTangents
[
d
]
=
new
THREE
.
Vector4
(
L
.
x
,
L
.
y
,
L
.
z
,
e
)}}
this
.
hasTangents
=
true
},
computeBoundingBox
:
function
(){
if
(
!
this
.
boundingBox
)
this
.
boundingBox
=
{
min
:
new
THREE
.
Vector3
,
max
:
new
THREE
.
Vector3
};
if
(
this
.
vertices
.
length
>
0
){
var
a
;
a
=
this
.
vertices
[
0
];
this
.
boundingBox
.
min
.
copy
(
a
);
this
.
boundingBox
.
max
.
copy
(
a
);
for
(
var
b
=
this
.
boundingBox
.
min
,
c
=
this
.
boundingBox
.
max
,
d
=
1
,
e
=
this
.
vertices
.
length
;
d
<
e
;
d
++
){
a
=
this
.
vertices
[
d
];
if
(
a
.
x
<
b
.
x
)
b
.
x
=
a
.
x
;
else
if
(
a
.
x
>
c
.
x
)
c
.
x
=
a
.
x
;
if
(
a
.
y
<
b
.
y
)
b
.
y
=
a
.
y
;
else
if
(
a
.
y
>
c
.
y
)
c
.
y
=
a
.
y
;
if
(
a
.
z
<
b
.
z
)
b
.
z
=
a
.
z
;
else
if
(
a
.
z
>
c
.
z
)
c
.
z
=
a
.
z
}}
else
{
this
.
boundingBox
.
min
.
set
(
0
,
0
,
0
);
this
.
boundingBox
.
max
.
set
(
0
,
0
,
0
)}},
computeBoundingSphere
:
function
(){
if
(
!
this
.
boundingSphere
)
this
.
boundingSphere
=
{
radius
:
0
};
for
(
var
a
,
b
=
0
,
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
){
a
=
this
.
vertices
[
c
].
length
();
a
>
b
&&
(
b
=
a
)}
this
.
boundingSphere
.
radius
=
b
},
mergeVertices
:
function
(){
var
a
=
{},
b
=
[],
c
=
[],
d
,
e
=
Math
.
pow
(
10
,
4
),
f
,
g
;
f
=
0
;
for
(
g
=
this
.
vertices
.
length
;
f
<
g
;
f
++
){
d
=
this
.
vertices
[
f
];
d
=
[
Math
.
round
(
d
.
x
*
e
),
Math
.
round
(
d
.
y
*
e
),
Math
.
round
(
d
.
z
*
e
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
f
;
b
.
push
(
this
.
vertices
[
f
]);
c
[
f
]
=
b
.
length
-
1
}
else
c
[
f
]
=
c
[
a
[
d
]]}
f
=
0
;
for
(
g
=
this
.
faces
.
length
;
f
<
g
;
f
++
){
a
=
this
.
faces
[
f
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
]
}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
THREE
.
Camera
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
new
THREE
.
Matrix4
;
this
.
projectionMatrixInverse
=
new
THREE
.
Matrix4
};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
THREE
.
Camera
.
prototype
.
lookAt
=
function
(
a
){
this
.
matrix
.
lookAt
(
this
.
position
,
a
,
this
.
up
);
this
.
rotationAutoUpdate
&&
this
.
rotation
.
getRotationFromMatrix
(
this
.
matrix
)};
e
),
Math
.
round
(
d
.
y
*
e
),
Math
.
round
(
d
.
z
*
e
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
f
;
b
.
push
(
this
.
vertices
[
f
]);
c
[
f
]
=
b
.
length
-
1
}
else
c
[
f
]
=
c
[
a
[
d
]]}
f
=
0
;
for
(
g
=
this
.
faces
.
length
;
f
<
g
;
f
++
){
a
=
this
.
faces
[
f
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
]
;
e
=
[
a
.
a
,
a
.
b
,
a
.
c
,
a
.
d
];
for
(
d
=
3
;
d
>
0
;
d
--
)
if
(
e
.
indexOf
(
a
[
"
abcd
"
[
d
]])
!=
d
){
e
.
splice
(
d
,
1
);
this
.
faces
[
f
]
=
new
THREE
.
Face3
(
e
[
0
],
e
[
1
],
e
[
2
]);
this
.
faceVertexUvs
[
0
][
f
].
splice
(
d
,
1
)}}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
THREE
.
Camera
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
new
THREE
.
Matrix4
;
this
.
projectionMatrixInverse
=
new
THREE
.
Matrix4
};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
THREE
.
Camera
.
prototype
.
lookAt
=
function
(
a
){
this
.
matrix
.
lookAt
(
this
.
position
,
a
,
this
.
up
);
this
.
rotationAutoUpdate
&&
this
.
rotation
.
getRotationFromMatrix
(
this
.
matrix
)};
THREE
.
OrthographicCamera
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
THREE
.
Camera
.
call
(
this
);
this
.
left
=
a
;
this
.
right
=
b
;
this
.
top
=
c
;
this
.
bottom
=
d
;
this
.
near
=
e
!==
void
0
?
e
:
0.1
;
this
.
far
=
f
!==
void
0
?
f
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
OrthographicCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
OrthographicCamera
.
prototype
.
constructor
=
THREE
.
OrthographicCamera
;
THREE
.
OrthographicCamera
.
prototype
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
.
makeOrthographic
(
this
.
left
,
this
.
right
,
this
.
top
,
this
.
bottom
,
this
.
near
,
this
.
far
)};
THREE
.
PerspectiveCamera
=
function
(
a
,
b
,
c
,
d
){
THREE
.
Camera
.
call
(
this
);
this
.
fov
=
a
!==
void
0
?
a
:
50
;
this
.
aspect
=
b
!==
void
0
?
b
:
1
;
this
.
near
=
c
!==
void
0
?
c
:
0.1
;
this
.
far
=
d
!==
void
0
?
d
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
PerspectiveCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PerspectiveCamera
.
prototype
.
constructor
=
THREE
.
PerspectiveCamera
;
THREE
.
PerspectiveCamera
.
prototype
.
setLens
=
function
(
a
,
b
){
this
.
fov
=
2
*
Math
.
atan
((
b
!==
void
0
?
b
:
24
)
/
(
a
*
2
))
*
(
180
/
Math
.
PI
);
this
.
updateProjectionMatrix
()};
THREE
.
PerspectiveCamera
.
prototype
.
setViewOffset
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
fullWidth
=
a
;
this
.
fullHeight
=
b
;
this
.
x
=
c
;
this
.
y
=
d
;
this
.
width
=
e
;
this
.
height
=
f
;
this
.
updateProjectionMatrix
()};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
803f4577
...
...
@@ -98,7 +98,8 @@ l=a.vertices[d];j=i[f];t=i[g];k=i[L];r=m.x-h.x;n=l.x-h.x;o=m.y-h.y;q=l.y-h.y;u=m
this
.
vertices
.
length
;
b
<
c
;
b
++
){
S
[
b
]
=
new
THREE
.
Vector3
;
K
[
b
]
=
new
THREE
.
Vector3
}
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
g
=
this
.
faces
[
b
];
i
=
this
.
faceVertexUvs
[
0
][
b
];
if
(
g
instanceof
THREE
.
Face3
)
a
(
this
,
g
.
a
,
g
.
b
,
g
.
c
,
0
,
1
,
2
);
else
if
(
g
instanceof
THREE
.
Face4
){
a
(
this
,
g
.
a
,
g
.
b
,
g
.
d
,
0
,
1
,
3
);
a
(
this
,
g
.
b
,
g
.
c
,
g
.
d
,
1
,
2
,
3
)}}
var
I
=
[
"
a
"
,
"
b
"
,
"
c
"
,
"
d
"
];
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
){
g
=
this
.
faces
[
b
];
for
(
d
=
0
;
d
<
g
.
vertexNormals
.
length
;
d
++
){
R
.
copy
(
g
.
vertexNormals
[
d
]);
f
=
g
[
I
[
d
]];
J
=
S
[
f
];
za
.
copy
(
J
);
za
.
subSelf
(
R
.
multiplyScalar
(
R
.
dot
(
J
))).
normalize
();
U
.
cross
(
g
.
vertexNormals
[
d
],
J
);
f
=
U
.
dot
(
K
[
f
]);
f
=
f
<
0
?
-
1
:
1
;
g
.
vertexTangents
[
d
]
=
new
THREE
.
Vector4
(
za
.
x
,
za
.
y
,
za
.
z
,
f
)}}
this
.
hasTangents
=
true
},
computeBoundingBox
:
function
(){
if
(
!
this
.
boundingBox
)
this
.
boundingBox
=
{
min
:
new
THREE
.
Vector3
,
max
:
new
THREE
.
Vector3
};
if
(
this
.
vertices
.
length
>
0
){
var
a
;
a
=
this
.
vertices
[
0
];
this
.
boundingBox
.
min
.
copy
(
a
);
this
.
boundingBox
.
max
.
copy
(
a
);
for
(
var
b
=
this
.
boundingBox
.
min
,
c
=
this
.
boundingBox
.
max
,
d
=
1
,
f
=
this
.
vertices
.
length
;
d
<
f
;
d
++
){
a
=
this
.
vertices
[
d
];
if
(
a
.
x
<
b
.
x
)
b
.
x
=
a
.
x
;
else
if
(
a
.
x
>
c
.
x
)
c
.
x
=
a
.
x
;
if
(
a
.
y
<
b
.
y
)
b
.
y
=
a
.
y
;
else
if
(
a
.
y
>
c
.
y
)
c
.
y
=
a
.
y
;
if
(
a
.
z
<
b
.
z
)
b
.
z
=
a
.
z
;
else
if
(
a
.
z
>
c
.
z
)
c
.
z
=
a
.
z
}}
else
{
this
.
boundingBox
.
min
.
set
(
0
,
0
,
0
);
this
.
boundingBox
.
max
.
set
(
0
,
0
,
0
)}},
computeBoundingSphere
:
function
(){
if
(
!
this
.
boundingSphere
)
this
.
boundingSphere
=
{
radius
:
0
};
for
(
var
a
,
b
=
0
,
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
){
a
=
this
.
vertices
[
c
].
length
();
a
>
b
&&
(
b
=
a
)}
this
.
boundingSphere
.
radius
=
b
},
mergeVertices
:
function
(){
var
a
=
{},
b
=
[],
c
=
[],
d
,
f
=
Math
.
pow
(
10
,
4
),
g
,
i
;
g
=
0
;
for
(
i
=
this
.
vertices
.
length
;
g
<
i
;
g
++
){
d
=
this
.
vertices
[
g
];
d
=
[
Math
.
round
(
d
.
x
*
f
),
Math
.
round
(
d
.
y
*
f
),
Math
.
round
(
d
.
z
*
f
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
g
;
b
.
push
(
this
.
vertices
[
g
]);
c
[
g
]
=
b
.
length
-
1
}
else
c
[
g
]
=
c
[
a
[
d
]]}
g
=
0
;
for
(
i
=
this
.
faces
.
length
;
g
<
i
;
g
++
){
a
=
this
.
faces
[
g
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
]}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
f
),
Math
.
round
(
d
.
y
*
f
),
Math
.
round
(
d
.
z
*
f
)].
join
(
"
_
"
);
if
(
a
[
d
]
===
void
0
){
a
[
d
]
=
g
;
b
.
push
(
this
.
vertices
[
g
]);
c
[
g
]
=
b
.
length
-
1
}
else
c
[
g
]
=
c
[
a
[
d
]]}
g
=
0
;
for
(
i
=
this
.
faces
.
length
;
g
<
i
;
g
++
){
a
=
this
.
faces
[
g
];
if
(
a
instanceof
THREE
.
Face3
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
]}
else
if
(
a
instanceof
THREE
.
Face4
){
a
.
a
=
c
[
a
.
a
];
a
.
b
=
c
[
a
.
b
];
a
.
c
=
c
[
a
.
c
];
a
.
d
=
c
[
a
.
d
];
f
=
[
a
.
a
,
a
.
b
,
a
.
c
,
a
.
d
];
for
(
d
=
3
;
d
>
0
;
d
--
)
if
(
f
.
indexOf
(
a
[
"
abcd
"
[
d
]])
!=
d
){
f
.
splice
(
d
,
1
);
this
.
faces
[
g
]
=
new
THREE
.
Face3
(
f
[
0
],
f
[
1
],
f
[
2
]);
this
.
faceVertexUvs
[
0
][
g
].
splice
(
d
,
1
)}}}
this
.
vertices
=
b
}};
THREE
.
GeometryCount
=
0
;
THREE
.
Spline
=
function
(
a
){
function
b
(
a
,
b
,
c
,
d
,
f
,
g
,
i
){
a
=
(
c
-
a
)
*
0.5
;
d
=
(
d
-
b
)
*
0.5
;
return
(
2
*
(
b
-
c
)
+
a
+
d
)
*
i
+
(
-
3
*
(
b
-
c
)
-
2
*
a
-
d
)
*
g
+
a
*
f
+
b
}
this
.
points
=
a
;
var
c
=
[],
d
=
{
x
:
0
,
y
:
0
,
z
:
0
},
f
,
g
,
i
,
h
,
m
,
l
,
j
,
t
,
k
;
this
.
initFromArray
=
function
(
a
){
this
.
points
=
[];
for
(
var
b
=
0
;
b
<
a
.
length
;
b
++
)
this
.
points
[
b
]
=
{
x
:
a
[
b
][
0
],
y
:
a
[
b
][
1
],
z
:
a
[
b
][
2
]}};
this
.
getPoint
=
function
(
a
){
f
=
(
this
.
points
.
length
-
1
)
*
a
;
g
=
Math
.
floor
(
f
);
i
=
f
-
g
;
c
[
0
]
=
g
===
0
?
g
:
g
-
1
;
c
[
1
]
=
g
;
c
[
2
]
=
g
>
this
.
points
.
length
-
2
?
this
.
points
.
length
-
1
:
g
+
1
;
c
[
3
]
=
g
>
this
.
points
.
length
-
3
?
this
.
points
.
length
-
1
:
g
+
2
;
l
=
this
.
points
[
c
[
0
]];
j
=
this
.
points
[
c
[
1
]];
t
=
this
.
points
[
c
[
2
]];
k
=
this
.
points
[
c
[
3
]];
h
=
i
*
i
;
m
=
i
*
h
;
d
.
x
=
b
(
l
.
x
,
j
.
x
,
t
.
x
,
k
.
x
,
i
,
h
,
m
);
d
.
y
=
b
(
l
.
y
,
j
.
y
,
t
.
y
,
k
.
y
,
i
,
h
,
m
);
d
.
z
=
b
(
l
.
z
,
j
.
z
,
t
.
z
,
k
.
z
,
i
,
h
,
m
);
return
d
};
this
.
getControlPointsArray
=
function
(){
var
a
,
b
,
c
=
this
.
points
.
length
,
d
=
[];
for
(
a
=
0
;
a
<
c
;
a
++
){
b
=
this
.
points
[
a
];
d
[
a
]
=
[
b
.
x
,
b
.
y
,
b
.
z
]}
return
d
};
this
.
getLength
=
function
(
a
){
var
b
,
c
,
d
,
f
=
b
=
b
=
0
,
g
=
new
THREE
.
Vector3
,
i
=
new
THREE
.
Vector3
,
h
=
[],
j
=
0
;
h
[
0
]
=
0
;
a
||
(
a
=
100
);
c
=
this
.
points
.
length
*
a
;
g
.
copy
(
this
.
points
[
0
]);
for
(
a
=
1
;
a
<
c
;
a
++
){
b
=
a
/
c
;
d
=
this
.
getPoint
(
b
);
i
.
copy
(
d
);
j
=
j
+
i
.
distanceTo
(
g
);
g
.
copy
(
d
);
b
=
(
this
.
points
.
length
-
1
)
*
b
;
b
=
Math
.
floor
(
b
);
if
(
b
!=
f
){
h
[
b
]
=
j
;
f
=
b
}}
h
[
h
.
length
]
=
j
;
return
{
chunks
:
h
,
total
:
j
}};
this
.
reparametrizeByArcLength
=
function
(
a
){
var
b
,
c
,
d
,
f
,
g
,
i
,
h
=
[],
j
=
new
THREE
.
Vector3
,
k
=
this
.
getLength
();
h
.
push
(
j
.
copy
(
this
.
points
[
0
]).
clone
());
for
(
b
=
1
;
b
<
this
.
points
.
length
;
b
++
){
c
=
k
.
chunks
[
b
]
-
k
.
chunks
[
b
-
1
];
i
=
Math
.
ceil
(
a
*
c
/
k
.
total
);
f
=
(
b
-
1
)
/
(
this
.
points
.
length
-
1
);
g
=
b
/
(
this
.
points
.
length
-
1
);
for
(
c
=
1
;
c
<
i
-
1
;
c
++
){
d
=
f
+
c
*
(
1
/
i
)
*
(
g
-
f
);
d
=
this
.
getPoint
(
d
);
...
...
src/extra
s/loaders/UTF8Loader.js
→
examples/j
s/loaders/UTF8Loader.js
浏览文件 @
803f4577
文件已移动
examples/js/ctm/CTMLoader.js
→
examples/js/
loaders/
ctm/CTMLoader.js
浏览文件 @
803f4577
...
...
@@ -109,7 +109,7 @@ THREE.CTMLoader.prototype.load = function( url, callback, useWorker, useBuffers,
if
(
useWorker
)
{
var
worker
=
new
Worker
(
"
js/ctm/CTMWorker.js
"
);
var
worker
=
new
Worker
(
"
js/
loaders/
ctm/CTMWorker.js
"
);
worker
.
onmessage
=
function
(
event
)
{
...
...
examples/js/ctm/CTMWorker.js
→
examples/js/
loaders/
ctm/CTMWorker.js
浏览文件 @
803f4577
文件已移动
examples/js/ctm/ctm.js
→
examples/js/
loaders/
ctm/ctm.js
浏览文件 @
803f4577
文件已移动
examples/js/ctm/license/OpenCTM.txt
→
examples/js/
loaders/
ctm/license/OpenCTM.txt
浏览文件 @
803f4577
文件已移动
examples/js/ctm/license/js-lzma.txt
→
examples/js/
loaders/
ctm/license/js-lzma.txt
浏览文件 @
803f4577
文件已移动
examples/js/ctm/license/js-openctm.txt
→
examples/js/
loaders/
ctm/license/js-openctm.txt
浏览文件 @
803f4577
文件已移动
examples/js/ctm/lzma.js
→
examples/js/
loaders/
ctm/lzma.js
浏览文件 @
803f4577
文件已移动
examples/webgl_loader_ctm.html
浏览文件 @
803f4577
...
...
@@ -37,9 +37,9 @@
<script
src=
"../build/Three.js"
></script>
<script
src=
"js/ctm/lzma.js"
></script>
<script
src=
"js/ctm/ctm.js"
></script>
<script
src=
"js/ctm/CTMLoader.js"
></script>
<script
src=
"js/
loaders/
ctm/lzma.js"
></script>
<script
src=
"js/
loaders/
ctm/ctm.js"
></script>
<script
src=
"js/
loaders/
ctm/CTMLoader.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/Stats.js"
></script>
...
...
examples/webgl_loader_ctm_materials.html
浏览文件 @
803f4577
...
...
@@ -39,9 +39,9 @@
<script
src=
"../build/Three.js"
></script>
<script
src=
"js/ctm/lzma.js"
></script>
<script
src=
"js/ctm/ctm.js"
></script>
<script
src=
"js/ctm/CTMLoader.js"
></script>
<script
src=
"js/
loaders/
ctm/lzma.js"
></script>
<script
src=
"js/
loaders/
ctm/ctm.js"
></script>
<script
src=
"js/
loaders/
ctm/CTMLoader.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/Stats.js"
></script>
...
...
examples/webgl_loader_utf8.html
浏览文件 @
803f4577
...
...
@@ -33,6 +33,7 @@
</div>
<script
src=
"../build/Three.js"
></script>
<script
src=
"js/loaders/UTF8Loader.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/Stats.js"
></script>
...
...
utils/build.py
浏览文件 @
803f4577
...
...
@@ -131,7 +131,6 @@ EXTRAS_FILES = [
'extras/loaders/ColladaLoader.js'
,
'extras/loaders/JSONLoader.js'
,
'extras/loaders/SceneLoader.js'
,
'extras/loaders/UTF8Loader.js'
,
'extras/objects/ImmediateRenderObject.js'
,
'extras/objects/LensFlare.js'
,
'extras/objects/MorphBlendMesh.js'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录