Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
1bfb6dbe
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,发现更多精彩内容 >>
提交
1bfb6dbe
编写于
6月 13, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/master'
上级
39d66202
7991af21
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
build/Three.js
build/Three.js
+2
-2
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+2
-2
src/objects/Sprite.js
src/objects/Sprite.js
+1
-1
未找到文件。
build/Three.js
浏览文件 @
1bfb6dbe
...
...
@@ -133,8 +133,8 @@ THREE.ShadowVolume.prototype.calculateShadowVolumeGeometryWithoutEdgeInfo=functi
for
(
k
=
0
;
k
<
n
;
k
++
)
o
=
b
[
j
[
p
[
k
]]],
c
.
push
(
new
THREE
.
Vertex
(
o
.
position
.
clone
()))}
for
(
f
=
0
;
f
<
g
.
length
-
1
;
f
++
){
b
=
d
[
f
];
for
(
j
=
f
+
1
;
j
<
g
.
length
;
j
++
)
k
=
d
[
j
],
k
=
this
.
facesShareEdge
(
c
,
b
,
k
),
k
!==
void
0
&&
(
k
=
new
THREE
.
Face4
(
k
.
indices
[
0
],
k
.
indices
[
3
],
k
.
indices
[
2
],
k
.
indices
[
1
]),
k
.
normal
.
set
(
1
,
0
,
0
),
e
.
push
(
k
))}};
THREE
.
ShadowVolume
.
prototype
.
facesShareEdge
=
function
(
b
,
c
,
d
){
var
e
,
g
,
f
,
j
,
k
,
m
,
n
,
o
,
p
,
t
,
u
,
v
,
z
,
B
=
0
,
y
=
[
"
a
"
,
"
b
"
,
"
c
"
,
"
d
"
];
e
=
c
instanceof
THREE
.
Face4
?
4
:
3
;
g
=
d
instanceof
THREE
.
Face4
?
4
:
3
;
for
(
v
=
0
;
v
<
e
;
v
++
){
f
=
c
[
y
[
v
]];
k
=
b
[
f
];
for
(
z
=
0
;
z
<
g
;
z
++
)
if
(
j
=
d
[
y
[
z
]],
m
=
b
[
j
],
Math
.
abs
(
k
.
position
.
x
-
m
.
position
.
x
)
<
1.0
E
-
4
&&
Math
.
abs
(
k
.
position
.
y
-
m
.
position
.
y
)
<
1.0
E
-
4
&&
Math
.
abs
(
k
.
position
.
z
-
m
.
position
.
z
)
<
1.0
E
-
4
&&
(
B
++
,
B
===
1
&&
(
n
=
k
,
o
=
m
,
p
=
f
,
t
=
j
,
u
=
y
[
v
]),
B
===
2
))
return
u
+=
y
[
v
],
u
===
"
ad
"
||
u
===
"
ac
"
?{
faces
:[
c
,
d
],
vertices
:[
n
,
o
,
m
,
k
],
indices
:[
p
,
t
,
j
,
f
],
vertexTypes
:[
1
,
2
,
2
,
1
],
extrudable
:
!
0
}:{
faces
:[
c
,
d
],
vertices
:[
n
,
k
,
m
,
o
],
indices
:[
p
,
f
,
j
,
t
],
vertexTypes
:[
1
,
1
,
2
,
2
],
extrudable
:
!
0
}}};
THREE
.
Sprite
=
function
(
b
){
THREE
.
Object3D
.
call
(
this
);
if
(
b
.
material
!==
void
0
)
this
.
material
=
b
.
material
,
this
.
map
=
void
0
,
this
.
blending
=
material
.
blending
;
else
if
(
b
.
map
!==
void
0
)
this
.
map
=
b
.
map
instanceof
THREE
.
Texture
?
b
.
map
:
ImageUtils
.
loadTexture
(
b
.
map
),
this
.
material
=
void
0
,
this
.
blending
=
b
.
blending
!==
void
0
?
b
.
blending
:
THREE
.
NormalBlending
;
this
.
useScreenCoordinates
=
b
.
useScreenCoordinates
!==
void
0
?
b
.
useScreenCoordinates
:
!
0
;
this
.
mergeWith3D
=
b
.
mergeWith3D
!==
void
0
?
b
.
mergeWith3D
:
!
this
.
useScreenCoordinates
;
this
.
affectedByDistance
=
b
.
affectedByDistance
!==
void
0
?
b
.
affectedByDistance
:
!
this
.
useScreenCoordinates
;
this
.
alignment
=
b
.
alignment
instanceof
THREE
.
Vector2
?
b
.
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
;
THREE
.
Sprite
.
prototype
.
constructor
=
THREE
.
Sprite
;
THREE
.
Sprite
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Sprite
=
function
(
b
){
THREE
.
Object3D
.
call
(
this
);
if
(
b
.
material
!==
void
0
)
this
.
material
=
b
.
material
,
this
.
map
=
void
0
,
this
.
blending
=
material
.
blending
;
else
if
(
b
.
map
!==
void
0
)
this
.
map
=
b
.
map
instanceof
THREE
.
Texture
?
b
.
map
:
THREE
.
ImageUtils
.
loadTexture
(
b
.
map
),
this
.
material
=
void
0
,
this
.
blending
=
b
.
blending
!==
void
0
?
b
.
blending
:
THREE
.
NormalBlending
;
this
.
useScreenCoordinates
=
b
.
useScreenCoordinates
!==
void
0
?
b
.
useScreenCoordinates
:
!
0
;
this
.
mergeWith3D
=
b
.
mergeWith3D
!==
void
0
?
b
.
mergeWith3D
:
!
this
.
useScreenCoordinates
;
this
.
affectedByDistance
=
b
.
affectedByDistance
!==
void
0
?
b
.
affectedByDistance
:
!
this
.
useScreenCoordinates
;
this
.
alignment
=
b
.
alignment
instanceof
THREE
.
Vector2
?
b
.
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
;
THREE
.
Sprite
.
prototype
.
constructor
=
THREE
.
Sprite
;
THREE
.
Sprite
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Sprite
.
prototype
.
updateMatrix
=
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
rotation3d
.
set
(
0
,
0
,
this
.
rotation
);
this
.
matrix
.
setRotationFromEuler
(
this
.
rotation3d
);
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
)
this
.
matrix
.
scale
(
this
.
scale
),
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
this
.
scale
.
y
);
this
.
matrixWorldNeedsUpdate
=!
0
};
THREE
.
SpriteAlignment
=
{};
THREE
.
SpriteAlignment
.
topLeft
=
new
THREE
.
Vector2
(
1
,
-
1
);
THREE
.
SpriteAlignment
.
topCenter
=
new
THREE
.
Vector2
(
0
,
-
1
);
THREE
.
SpriteAlignment
.
topRight
=
new
THREE
.
Vector2
(
-
1
,
-
1
);
THREE
.
SpriteAlignment
.
centerLeft
=
new
THREE
.
Vector2
(
1
,
0
);
THREE
.
SpriteAlignment
.
center
=
new
THREE
.
Vector2
(
0
,
0
);
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
);
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixAutoUpdate
=!
1
;
this
.
collisions
=
this
.
fog
=
null
;
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
__objectsAdded
=
[];
this
.
__objectsRemoved
=
[]};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
b
){
this
.
supr
.
addChild
.
call
(
this
,
b
);
this
.
addChildRecurse
(
b
)};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
1bfb6dbe
...
...
@@ -132,8 +132,8 @@ THREE.ShadowVolume.prototype.calculateShadowVolumeGeometryWithoutEdgeInfo=functi
for
(
j
=
0
;
j
<
k
;
j
++
)
n
=
b
[
g
[
v
[
j
]]],
d
.
push
(
new
THREE
.
Vertex
(
n
.
position
.
clone
()))}
for
(
i
=
0
;
i
<
h
.
length
-
1
;
i
++
){
b
=
e
[
i
];
for
(
g
=
i
+
1
;
g
<
h
.
length
;
g
++
)
j
=
e
[
g
],
j
=
this
.
facesShareEdge
(
d
,
b
,
j
),
j
!==
void
0
&&
(
j
=
new
THREE
.
Face4
(
j
.
indices
[
0
],
j
.
indices
[
3
],
j
.
indices
[
2
],
j
.
indices
[
1
]),
j
.
normal
.
set
(
1
,
0
,
0
),
f
.
push
(
j
))}};
THREE
.
ShadowVolume
.
prototype
.
facesShareEdge
=
function
(
b
,
d
,
e
){
var
f
,
h
,
i
,
g
,
j
,
p
,
k
,
n
,
v
,
r
,
q
,
z
,
C
,
D
=
0
,
y
=
[
"
a
"
,
"
b
"
,
"
c
"
,
"
d
"
];
f
=
d
instanceof
THREE
.
Face4
?
4
:
3
;
h
=
e
instanceof
THREE
.
Face4
?
4
:
3
;
for
(
z
=
0
;
z
<
f
;
z
++
){
i
=
d
[
y
[
z
]];
j
=
b
[
i
];
for
(
C
=
0
;
C
<
h
;
C
++
)
if
(
g
=
e
[
y
[
C
]],
p
=
b
[
g
],
Math
.
abs
(
j
.
position
.
x
-
p
.
position
.
x
)
<
1.0
E
-
4
&&
Math
.
abs
(
j
.
position
.
y
-
p
.
position
.
y
)
<
1.0
E
-
4
&&
Math
.
abs
(
j
.
position
.
z
-
p
.
position
.
z
)
<
1.0
E
-
4
&&
(
D
++
,
D
===
1
&&
(
k
=
j
,
n
=
p
,
v
=
i
,
r
=
g
,
q
=
y
[
z
]),
D
===
2
))
return
q
+=
y
[
z
],
q
===
"
ad
"
||
q
===
"
ac
"
?{
faces
:[
d
,
e
],
vertices
:[
k
,
n
,
p
,
j
],
indices
:[
v
,
r
,
g
,
i
],
vertexTypes
:[
1
,
2
,
2
,
1
],
extrudable
:
!
0
}:{
faces
:[
d
,
e
],
vertices
:[
k
,
j
,
p
,
n
],
indices
:[
v
,
i
,
g
,
r
],
vertexTypes
:[
1
,
1
,
2
,
2
],
extrudable
:
!
0
}}};
THREE
.
Sprite
=
function
(
b
){
THREE
.
Object3D
.
call
(
this
);
if
(
b
.
material
!==
void
0
)
this
.
material
=
b
.
material
,
this
.
map
=
void
0
,
this
.
blending
=
material
.
blending
;
else
if
(
b
.
map
!==
void
0
)
this
.
map
=
b
.
map
instanceof
THREE
.
Texture
?
b
.
map
:
ImageUtils
.
loadTexture
(
b
.
map
),
this
.
material
=
void
0
,
this
.
blending
=
b
.
blending
!==
void
0
?
b
.
blending
:
THREE
.
NormalBlending
;
this
.
useScreenCoordinates
=
b
.
useScreenCoordinates
!==
void
0
?
b
.
useScreenCoordinates
:
!
0
;
this
.
mergeWith3D
=
b
.
mergeWith3D
!==
void
0
?
b
.
mergeWith3D
:
!
this
.
useScreenCoordinates
;
this
.
affectedByDistance
=
b
.
affectedByDistance
!==
void
0
?
b
.
affectedByDistance
:
!
this
.
useScreenCoordinates
;
this
.
alignment
=
b
.
alignment
instanceof
THREE
.
Vector2
?
b
.
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
;
THREE
.
Sprite
.
prototype
.
constructor
=
THREE
.
Sprite
;
THREE
.
Sprite
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Sprite
=
function
(
b
){
THREE
.
Object3D
.
call
(
this
);
if
(
b
.
material
!==
void
0
)
this
.
material
=
b
.
material
,
this
.
map
=
void
0
,
this
.
blending
=
material
.
blending
;
else
if
(
b
.
map
!==
void
0
)
this
.
map
=
b
.
map
instanceof
THREE
.
Texture
?
b
.
map
:
THREE
.
ImageUtils
.
loadTexture
(
b
.
map
),
this
.
material
=
void
0
,
this
.
blending
=
b
.
blending
!==
void
0
?
b
.
blending
:
THREE
.
NormalBlending
;
this
.
useScreenCoordinates
=
b
.
useScreenCoordinates
!==
void
0
?
b
.
useScreenCoordinates
:
!
0
;
this
.
mergeWith3D
=
b
.
mergeWith3D
!==
void
0
?
b
.
mergeWith3D
:
!
this
.
useScreenCoordinates
;
this
.
affectedByDistance
=
b
.
affectedByDistance
!==
void
0
?
b
.
affectedByDistance
:
!
this
.
useScreenCoordinates
;
this
.
alignment
=
b
.
alignment
instanceof
THREE
.
Vector2
?
b
.
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
;
THREE
.
Sprite
.
prototype
.
constructor
=
THREE
.
Sprite
;
THREE
.
Sprite
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Sprite
.
prototype
.
updateMatrix
=
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
rotation3d
.
set
(
0
,
0
,
this
.
rotation
);
this
.
matrix
.
setRotationFromEuler
(
this
.
rotation3d
);
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
)
this
.
matrix
.
scale
(
this
.
scale
),
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
this
.
scale
.
y
);
this
.
matrixWorldNeedsUpdate
=!
0
};
THREE
.
SpriteAlignment
=
{};
THREE
.
SpriteAlignment
.
topLeft
=
new
THREE
.
Vector2
(
1
,
-
1
);
THREE
.
SpriteAlignment
.
topCenter
=
new
THREE
.
Vector2
(
0
,
-
1
);
THREE
.
SpriteAlignment
.
topRight
=
new
THREE
.
Vector2
(
-
1
,
-
1
);
THREE
.
SpriteAlignment
.
centerLeft
=
new
THREE
.
Vector2
(
1
,
0
);
THREE
.
SpriteAlignment
.
center
=
new
THREE
.
Vector2
(
0
,
0
);
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
);
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
matrixAutoUpdate
=!
1
;
this
.
collisions
=
this
.
fog
=
null
;
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
__objectsAdded
=
[];
this
.
__objectsRemoved
=
[]};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
b
){
this
.
supr
.
addChild
.
call
(
this
,
b
);
this
.
addChildRecurse
(
b
)};
...
...
src/objects/Sprite.js
浏览文件 @
1bfb6dbe
...
...
@@ -14,7 +14,7 @@ THREE.Sprite = function( parameters ) {
}
else
if
(
parameters
.
map
!==
undefined
)
{
this
.
map
=
parameters
.
map
instanceof
THREE
.
Texture
?
parameters
.
map
:
ImageUtils
.
loadTexture
(
parameters
.
map
);
this
.
map
=
parameters
.
map
instanceof
THREE
.
Texture
?
parameters
.
map
:
THREE
.
ImageUtils
.
loadTexture
(
parameters
.
map
);
this
.
material
=
undefined
;
this
.
blending
=
parameters
.
blending
!==
undefined
?
parameters
.
blending
:
THREE
.
NormalBlending
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录