Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
6a857400
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,发现更多精彩内容 >>
提交
6a857400
编写于
4月 09, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
REVISION ++
上级
76e7ea34
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
23 addition
and
16 deletion
+23
-16
README.md
README.md
+9
-0
REVISION
REVISION
+1
-1
build/Three.js
build/Three.js
+1
-1
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+1
-1
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+1
-1
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
src/objects/Sprite.js
src/objects/Sprite.js
+7
-9
未找到文件。
README.md
浏览文件 @
6a857400
...
...
@@ -139,6 +139,15 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
### Change Log ###
2011 04 09 -
**r39**
(249.048 KB, gzip: 61.020 KB)
*
Improved WebGLRenderer program cache. (
[
alteredq
](
http://github.com/alteredq
)
)
*
Added support for pre-computed edges in loaders and exporters. (
[
alteredq
](
http://github.com/alteredq
)
)
*
Added
`Sprite`
object. (
[
empaempa
](
http://github.com/empaempa
)
)
*
Added
`Collisions`
classes. (
[
drojdjou
](
http://github.com/drojdjou
)
)
*
Added
`THREE`
namespace to all the classes that missed it. (
[
mrdoob
](
http://github.com/mrdoob
)
)
2011 03 31 -
**r38**
(225.442 KB, gzip: 55.908 KB)
*
Added
`LensFlare`
light. (
[
empaempa
](
http://github.com/empaempa
)
)
...
...
REVISION
浏览文件 @
6a857400
3
8
3
9
build/Three.js
浏览文件 @
6a857400
// Three.js r3
8
- http://github.com/mrdoob/three.js
// Three.js r3
9
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
b
){
this
.
setHex
(
b
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
b
){
this
.
r
=
b
.
r
;
this
.
g
=
b
.
g
;
this
.
b
=
b
.
b
;
this
.
hex
=
b
.
hex
;
this
.
__styleString
=
b
.
__styleString
},
setRGB
:
function
(
b
,
d
,
c
){
this
.
r
=
b
;
this
.
g
=
d
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
b
,
d
,
c
){
var
f
,
g
,
h
,
j
,
k
,
m
;
if
(
c
==
0
)
f
=
g
=
h
=
0
;
else
{
j
=
Math
.
floor
(
b
*
6
);
k
=
b
*
6
-
j
;
b
=
c
*
(
1
-
d
);
m
=
c
*
(
1
-
d
*
k
);
d
=
c
*
(
1
-
d
*
(
1
-
k
));
switch
(
j
){
case
1
:
f
=
m
;
g
=
c
;
h
=
b
;
break
;
case
2
:
f
=
b
;
g
=
c
;
h
=
d
;
break
;
case
3
:
f
=
b
;
g
=
m
;
h
=
c
;
break
;
case
4
:
f
=
d
;
g
=
b
;
h
=
c
;
break
;
case
5
:
f
=
c
;
g
=
b
;
h
=
m
;
break
;
case
6
:
case
0
:
f
=
c
;
g
=
d
;
h
=
b
}}
this
.
r
=
f
;
this
.
g
=
g
;
this
.
b
=
h
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHex
:
function
(
b
){
this
.
hex
=~~
b
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
this
.
updateStyleString
()}},
updateHex
:
function
(){
this
.
hex
=~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
updateRGB
:
function
(){
this
.
r
=
(
this
.
hex
>>
16
&
255
)
/
255
;
this
.
g
=
(
this
.
hex
>>
8
&
255
)
/
255
;
this
.
b
=
(
this
.
hex
&
255
)
/
255
},
updateStyleString
:
function
(){
this
.
__styleString
=
"
rgb(
"
+~~
(
this
.
r
*
255
)
+
"
,
"
+~~
(
this
.
g
*
...
...
build/custom/ThreeCanvas.js
浏览文件 @
6a857400
// ThreeCanvas.js r3
8
- http://github.com/mrdoob/three.js
// ThreeCanvas.js r3
9
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
var
e
,
d
,
g
,
f
,
i
,
h
;
if
(
c
==
0
)
e
=
d
=
g
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
i
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
h
=
c
*
(
1
-
b
*
i
);
b
=
c
*
(
1
-
b
*
(
1
-
i
));
switch
(
f
){
case
1
:
e
=
h
;
d
=
c
;
g
=
a
;
break
;
case
2
:
e
=
a
;
d
=
c
;
g
=
b
;
break
;
case
3
:
e
=
a
;
d
=
h
;
g
=
c
;
break
;
case
4
:
e
=
b
;
d
=
a
;
g
=
c
;
break
;
case
5
:
e
=
c
;
d
=
a
;
g
=
h
;
break
;
case
6
:
case
0
:
e
=
c
;
d
=
b
;
g
=
a
}}
this
.
r
=
e
;
this
.
g
=
d
;
this
.
b
=
g
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
this
.
updateStyleString
()}},
updateHex
:
function
(){
this
.
hex
=~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
updateRGB
:
function
(){
this
.
r
=
(
this
.
hex
>>
16
&
255
)
/
255
;
this
.
g
=
(
this
.
hex
>>
8
&
255
)
/
255
;
this
.
b
=
(
this
.
hex
&
255
)
/
255
},
updateStyleString
:
function
(){
this
.
__styleString
=
"
rgb(
"
+~~
(
this
.
r
*
255
)
+
"
,
"
+~~
(
this
.
g
*
...
...
build/custom/ThreeDOM.js
浏览文件 @
6a857400
// ThreeDOM.js r3
8
- http://github.com/mrdoob/three.js
// ThreeDOM.js r3
9
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
var
e
,
d
,
g
,
f
,
i
,
h
;
if
(
c
==
0
)
e
=
d
=
g
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
i
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
h
=
c
*
(
1
-
b
*
i
);
b
=
c
*
(
1
-
b
*
(
1
-
i
));
switch
(
f
){
case
1
:
e
=
h
;
d
=
c
;
g
=
a
;
break
;
case
2
:
e
=
a
;
d
=
c
;
g
=
b
;
break
;
case
3
:
e
=
a
;
d
=
h
;
g
=
c
;
break
;
case
4
:
e
=
b
;
d
=
a
;
g
=
c
;
break
;
case
5
:
e
=
c
;
d
=
a
;
g
=
h
;
break
;
case
6
:
case
0
:
e
=
c
;
d
=
b
;
g
=
a
}}
this
.
r
=
e
;
this
.
g
=
d
;
this
.
b
=
g
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
this
.
updateStyleString
()}},
updateHex
:
function
(){
this
.
hex
=~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
updateRGB
:
function
(){
this
.
r
=
(
this
.
hex
>>
16
&
255
)
/
255
;
this
.
g
=
(
this
.
hex
>>
8
&
255
)
/
255
;
this
.
b
=
(
this
.
hex
&
255
)
/
255
},
updateStyleString
:
function
(){
this
.
__styleString
=
"
rgb(
"
+~~
(
this
.
r
*
255
)
+
"
,
"
+~~
(
this
.
g
*
...
...
build/custom/ThreeExtras.js
浏览文件 @
6a857400
// ThreeExtras.js r3
8
- http://github.com/mrdoob/three.js
// ThreeExtras.js r3
9
- http://github.com/mrdoob/three.js
var
GeometryUtils
=
{
merge
:
function
(
a
,
b
){
var
c
=
b
instanceof
THREE
.
Mesh
,
d
=
a
.
vertices
.
length
,
e
=
c
?
b
.
geometry
:
b
,
f
=
a
.
vertices
,
h
=
e
.
vertices
,
g
=
a
.
faces
,
j
=
e
.
faces
,
l
=
a
.
faceVertexUvs
[
0
];
e
=
e
.
faceVertexUvs
[
0
];
c
&&
b
.
matrixAutoUpdate
&&
b
.
updateMatrix
();
for
(
var
k
=
0
,
n
=
h
.
length
;
k
<
n
;
k
++
){
var
p
=
new
THREE
.
Vertex
(
h
[
k
].
position
.
clone
());
c
&&
b
.
matrix
.
multiplyVector3
(
p
.
position
);
f
.
push
(
p
)}
k
=
0
;
for
(
n
=
j
.
length
;
k
<
n
;
k
++
){
h
=
j
[
k
];
var
t
,
w
,
x
=
h
.
vertexNormals
;
p
=
h
.
vertexColors
;
if
(
h
instanceof
THREE
.
Face3
)
t
=
new
THREE
.
Face3
(
h
.
a
+
d
,
h
.
b
+
d
,
h
.
c
+
d
);
else
h
instanceof
THREE
.
Face4
&&
(
t
=
new
THREE
.
Face4
(
h
.
a
+
d
,
h
.
b
+
d
,
h
.
c
+
d
,
h
.
d
+
d
));
t
.
normal
.
copy
(
h
.
normal
);
c
=
0
;
for
(
f
=
x
.
length
;
c
<
f
;
c
++
){
w
=
x
[
c
];
t
.
vertexNormals
.
push
(
w
.
clone
())}
t
.
color
.
copy
(
h
.
color
);
c
=
0
;
for
(
f
=
p
.
length
;
c
<
f
;
c
++
){
w
=
p
[
c
];
t
.
vertexColors
.
push
(
w
.
clone
())}
t
.
materials
=
h
.
materials
.
slice
();
t
.
centroid
.
copy
(
h
.
centroid
);
g
.
push
(
t
)}
k
=
0
;
for
(
n
=
e
.
length
;
k
<
n
;
k
++
){
d
=
e
[
k
];
g
=
[];
c
=
0
;
for
(
f
=
d
.
length
;
c
<
f
;
c
++
)
g
.
push
(
new
THREE
.
UV
(
d
[
c
].
u
,
d
[
c
].
v
));
l
.
push
(
g
)}}};
THREE
.
ImageUtils
=
{
loadTexture
:
function
(
a
,
b
,
c
){
var
d
=
new
Image
,
e
=
new
THREE
.
Texture
(
d
,
b
);
d
.
onload
=
function
(){
e
.
needsUpdate
=!
0
;
c
&&
c
(
this
)};
d
.
src
=
a
;
return
e
},
loadTextureCube
:
function
(
a
,
b
,
c
){
var
d
,
e
=
[],
f
=
new
THREE
.
Texture
(
e
,
b
);
b
=
e
.
loadCount
=
0
;
for
(
d
=
a
.
length
;
b
<
d
;
++
b
){
e
[
b
]
=
new
Image
;
e
[
b
].
onload
=
function
(){
e
.
loadCount
+=
1
;
if
(
e
.
loadCount
==
6
)
f
.
needsUpdate
=!
0
;
c
&&
c
(
this
)};
e
[
b
].
src
=
a
[
b
]}
return
f
}};
...
...
build/custom/ThreeSVG.js
浏览文件 @
6a857400
// ThreeSVG.js r3
8
- http://github.com/mrdoob/three.js
// ThreeSVG.js r3
9
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
var
e
,
d
,
g
,
f
,
i
,
h
;
if
(
c
==
0
)
e
=
d
=
g
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
i
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
h
=
c
*
(
1
-
b
*
i
);
b
=
c
*
(
1
-
b
*
(
1
-
i
));
switch
(
f
){
case
1
:
e
=
h
;
d
=
c
;
g
=
a
;
break
;
case
2
:
e
=
a
;
d
=
c
;
g
=
b
;
break
;
case
3
:
e
=
a
;
d
=
h
;
g
=
c
;
break
;
case
4
:
e
=
b
;
d
=
a
;
g
=
c
;
break
;
case
5
:
e
=
c
;
d
=
a
;
g
=
h
;
break
;
case
6
:
case
0
:
e
=
c
;
d
=
b
;
g
=
a
}}
this
.
r
=
e
;
this
.
g
=
d
;
this
.
b
=
g
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
this
.
updateStyleString
()}},
updateHex
:
function
(){
this
.
hex
=~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
updateRGB
:
function
(){
this
.
r
=
(
this
.
hex
>>
16
&
255
)
/
255
;
this
.
g
=
(
this
.
hex
>>
8
&
255
)
/
255
;
this
.
b
=
(
this
.
hex
&
255
)
/
255
},
updateStyleString
:
function
(){
this
.
__styleString
=
"
rgb(
"
+~~
(
this
.
r
*
255
)
+
"
,
"
+~~
(
this
.
g
*
...
...
build/custom/ThreeWebGL.js
浏览文件 @
6a857400
// ThreeWebGL.js r3
8
- http://github.com/mrdoob/three.js
// ThreeWebGL.js r3
9
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
b
){
this
.
setHex
(
b
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
b
){
this
.
r
=
b
.
r
;
this
.
g
=
b
.
g
;
this
.
b
=
b
.
b
;
this
.
hex
=
b
.
hex
;
this
.
__styleString
=
b
.
__styleString
},
setRGB
:
function
(
b
,
e
,
d
){
this
.
r
=
b
;
this
.
g
=
e
;
this
.
b
=
d
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
b
,
e
,
d
){
var
h
,
g
,
k
,
i
,
p
,
q
;
if
(
d
==
0
)
h
=
g
=
k
=
0
;
else
{
i
=
Math
.
floor
(
b
*
6
);
p
=
b
*
6
-
i
;
b
=
d
*
(
1
-
e
);
q
=
d
*
(
1
-
e
*
p
);
e
=
d
*
(
1
-
e
*
(
1
-
p
));
switch
(
i
){
case
1
:
h
=
q
;
g
=
d
;
k
=
b
;
break
;
case
2
:
h
=
b
;
g
=
d
;
k
=
e
;
break
;
case
3
:
h
=
b
;
g
=
q
;
k
=
d
;
break
;
case
4
:
h
=
e
;
g
=
b
;
k
=
d
;
break
;
case
5
:
h
=
d
;
g
=
b
;
k
=
q
;
break
;
case
6
:
case
0
:
h
=
d
;
g
=
e
;
k
=
b
}}
this
.
r
=
h
;
this
.
g
=
g
;
this
.
b
=
k
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHex
:
function
(
b
){
this
.
hex
=~~
b
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
this
.
updateStyleString
()}},
updateHex
:
function
(){
this
.
hex
=~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
updateRGB
:
function
(){
this
.
r
=
(
this
.
hex
>>
16
&
255
)
/
255
;
this
.
g
=
(
this
.
hex
>>
8
&
255
)
/
255
;
this
.
b
=
(
this
.
hex
&
255
)
/
255
},
updateStyleString
:
function
(){
this
.
__styleString
=
"
rgb(
"
+~~
(
this
.
r
*
255
)
+
"
,
"
+~~
(
this
.
g
*
...
...
src/objects/Sprite.js
浏览文件 @
6a857400
...
...
@@ -3,7 +3,7 @@
*/
THREE
.
Sprite
=
function
(
parameters
)
{
THREE
.
Object3D
.
call
(
this
);
if
(
parameters
.
material
!==
undefined
)
{
...
...
@@ -11,27 +11,27 @@ THREE.Sprite = function( parameters ) {
this
.
material
=
parameters
.
material
;
this
.
map
=
undefined
;
this
.
blending
=
material
.
blending
;
}
else
if
(
parameters
.
map
!==
undefined
)
{
this
.
map
=
parameters
.
map
instanceof
THREE
.
Texture
?
parameters
.
map
:
ImageUtils
.
loadTexture
(
parameters
.
map
);
this
.
material
=
undefined
;
this
.
blending
=
parameters
.
blending
!==
undefined
?
parameters
.
blending
:
THREE
.
NormalBlending
;
}
this
.
useScreenCoordinates
=
parameters
.
useScreenCoordinates
!==
undefined
?
parameters
.
useScreenCoordinates
:
true
;
this
.
mergeWith3D
=
parameters
.
mergeWith3D
!==
undefined
?
parameters
.
mergeWith3D
:
!
this
.
useScreenCoordinates
;
this
.
affectedByDistance
=
parameters
.
affectedByDistance
!==
undefined
?
parameters
.
affectedByDistance
:
!
this
.
useScreenCoordinates
;
this
.
alignment
=
parameters
.
alignment
instanceof
THREE
.
Vector2
?
parameters
.
alignment
:
THREE
.
SpriteAlignment
.
center
;
this
.
rotation3d
=
this
.
rotation
;
this
.
rotation
=
0
;
this
.
opacity
=
1
;
this
.
uvOffset
=
new
THREE
.
Vector2
(
0
,
0
);
this
.
uvScale
=
new
THREE
.
Vector2
(
1
,
1
);
};
THREE
.
Sprite
.
prototype
=
new
THREE
.
Object3D
();
...
...
@@ -75,5 +75,3 @@ THREE.SpriteAlignment.centerRight = new THREE.Vector2( -1, 0 );
THREE
.
SpriteAlignment
.
bottomLeft
=
new
THREE
.
Vector2
(
1
,
1
);
THREE
.
SpriteAlignment
.
bottomCenter
=
new
THREE
.
Vector2
(
0
,
1
);
THREE
.
SpriteAlignment
.
bottomRight
=
new
THREE
.
Vector2
(
-
1
,
1
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录