Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f105cbb7
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,发现更多精彩内容 >>
提交
f105cbb7
编写于
9月 04, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
`LOD.add` > `LOD.addLevel`
上级
322b9f9d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
6 deletion
+6
-6
build/Three.js
build/Three.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
examples/webgl_lod.html
examples/webgl_lod.html
+1
-1
examples/webgl_lod_text.html
examples/webgl_lod_text.html
+1
-1
src/objects/LOD.js
src/objects/LOD.js
+2
-2
未找到文件。
build/Three.js
浏览文件 @
f105cbb7
...
...
@@ -131,7 +131,7 @@ THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixA
c
*
16
)}};
THREE
.
SkinnedMesh
.
prototype
.
addBone
=
function
(
b
){
b
===
void
0
&&
(
b
=
new
THREE
.
Bone
(
this
));
this
.
bones
.
push
(
b
);
return
b
};
THREE
.
SkinnedMesh
.
prototype
.
pose
=
function
(){
this
.
update
(
void
0
,
!
0
);
for
(
var
b
,
c
=
[],
e
=
0
;
e
<
this
.
bones
.
length
;
e
++
)
b
=
this
.
bones
[
e
],
c
.
push
(
THREE
.
Matrix4
.
makeInvert
(
b
.
skinMatrix
)),
b
.
skinMatrix
.
flattenToArrayOffset
(
this
.
boneMatrices
,
e
*
16
);
if
(
this
.
geometry
.
skinVerticesA
===
void
0
){
this
.
geometry
.
skinVerticesA
=
[];
this
.
geometry
.
skinVerticesB
=
[];
var
f
;
for
(
b
=
0
;
b
<
this
.
geometry
.
skinIndices
.
length
;
b
++
){
var
e
=
this
.
geometry
.
vertices
[
b
].
position
,
h
=
this
.
geometry
.
skinIndices
[
b
].
x
,
m
=
this
.
geometry
.
skinIndices
[
b
].
y
;
f
=
new
THREE
.
Vector3
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
geometry
.
skinVerticesA
.
push
(
c
[
h
].
multiplyVector3
(
f
));
f
=
new
THREE
.
Vector3
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
geometry
.
skinVerticesB
.
push
(
c
[
m
].
multiplyVector3
(
f
));
this
.
geometry
.
skinWeights
[
b
].
x
+
this
.
geometry
.
skinWeights
[
b
].
y
!==
1
&&
(
e
=
(
1
-
(
this
.
geometry
.
skinWeights
[
b
].
x
+
this
.
geometry
.
skinWeights
[
b
].
y
))
*
0.5
,
this
.
geometry
.
skinWeights
[
b
].
x
+=
e
,
this
.
geometry
.
skinWeights
[
b
].
y
+=
e
)}}};
THREE
.
Ribbon
=
function
(
b
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
b
;
this
.
materials
=
c
instanceof
Array
?
c
:[
c
]};
THREE
.
Ribbon
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Ribbon
.
prototype
.
constructor
=
THREE
.
Ribbon
;
THREE
.
LOD
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
LODs
=
[]};
THREE
.
LOD
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
LOD
.
prototype
.
constructor
=
THREE
.
LOD
;
THREE
.
LOD
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
LOD
.
prototype
.
add
=
function
(
b
,
c
){
c
===
void
0
&&
(
c
=
0
);
for
(
var
c
=
Math
.
abs
(
c
),
e
=
0
;
e
<
this
.
LODs
.
length
;
e
++
)
if
(
c
<
this
.
LODs
[
e
].
visibleAtDistance
)
break
;
this
.
LODs
.
splice
(
e
,
0
,{
visibleAtDistance
:
c
,
object3D
:
b
});
this
.
addChil
d
(
b
)};
THREE
.
Ribbon
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Ribbon
.
prototype
.
constructor
=
THREE
.
Ribbon
;
THREE
.
LOD
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
LODs
=
[]};
THREE
.
LOD
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
LOD
.
prototype
.
constructor
=
THREE
.
LOD
;
THREE
.
LOD
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
LOD
.
prototype
.
add
Level
=
function
(
b
,
c
){
c
===
void
0
&&
(
c
=
0
);
for
(
var
c
=
Math
.
abs
(
c
),
e
=
0
;
e
<
this
.
LODs
.
length
;
e
++
)
if
(
c
<
this
.
LODs
[
e
].
visibleAtDistance
)
break
;
this
.
LODs
.
splice
(
e
,
0
,{
visibleAtDistance
:
c
,
object3D
:
b
});
this
.
ad
d
(
b
)};
THREE
.
LOD
.
prototype
.
update
=
function
(
b
,
c
,
e
){
this
.
matrixAutoUpdate
&&
(
c
|=
this
.
updateMatrix
());
if
(
c
||
this
.
matrixWorldNeedsUpdate
)
b
?
this
.
matrixWorld
.
multiply
(
b
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
),
this
.
matrixWorldNeedsUpdate
=!
1
,
c
=!
0
;
if
(
this
.
LODs
.
length
>
1
){
b
=
e
.
matrixWorldInverse
;
b
=-
(
b
.
n31
*
this
.
position
.
x
+
b
.
n32
*
this
.
position
.
y
+
b
.
n33
*
this
.
position
.
z
+
b
.
n34
);
this
.
LODs
[
0
].
object3D
.
visible
=!
0
;
for
(
var
f
=
1
;
f
<
this
.
LODs
.
length
;
f
++
)
if
(
b
>=
this
.
LODs
[
f
].
visibleAtDistance
)
this
.
LODs
[
f
-
1
].
object3D
.
visible
=!
1
,
this
.
LODs
[
f
].
object3D
.
visible
=!
0
;
else
break
;
for
(;
f
<
this
.
LODs
.
length
;
f
++
)
this
.
LODs
[
f
].
object3D
.
visible
=!
1
}
for
(
b
=
0
;
b
<
this
.
children
.
length
;
b
++
)
this
.
children
[
b
].
update
(
this
.
matrixWorld
,
c
,
e
)};
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
;
...
...
build/custom/ThreeWebGL.js
浏览文件 @
f105cbb7
...
...
@@ -128,7 +128,7 @@ THREE.SkinnedMesh.prototype.update=function(b,c,d){if(this.visible){this.matrixA
c
*
16
)}};
THREE
.
SkinnedMesh
.
prototype
.
addBone
=
function
(
b
){
b
===
void
0
&&
(
b
=
new
THREE
.
Bone
(
this
));
this
.
bones
.
push
(
b
);
return
b
};
THREE
.
SkinnedMesh
.
prototype
.
pose
=
function
(){
this
.
update
(
void
0
,
!
0
);
for
(
var
b
,
c
=
[],
d
=
0
;
d
<
this
.
bones
.
length
;
d
++
)
b
=
this
.
bones
[
d
],
c
.
push
(
THREE
.
Matrix4
.
makeInvert
(
b
.
skinMatrix
)),
b
.
skinMatrix
.
flattenToArrayOffset
(
this
.
boneMatrices
,
d
*
16
);
if
(
this
.
geometry
.
skinVerticesA
===
void
0
){
this
.
geometry
.
skinVerticesA
=
[];
this
.
geometry
.
skinVerticesB
=
[];
var
e
;
for
(
b
=
0
;
b
<
this
.
geometry
.
skinIndices
.
length
;
b
++
){
var
d
=
this
.
geometry
.
vertices
[
b
].
position
,
j
=
this
.
geometry
.
skinIndices
[
b
].
x
,
h
=
this
.
geometry
.
skinIndices
[
b
].
y
;
e
=
new
THREE
.
Vector3
(
d
.
x
,
d
.
y
,
d
.
z
);
this
.
geometry
.
skinVerticesA
.
push
(
c
[
j
].
multiplyVector3
(
e
));
e
=
new
THREE
.
Vector3
(
d
.
x
,
d
.
y
,
d
.
z
);
this
.
geometry
.
skinVerticesB
.
push
(
c
[
h
].
multiplyVector3
(
e
));
this
.
geometry
.
skinWeights
[
b
].
x
+
this
.
geometry
.
skinWeights
[
b
].
y
!==
1
&&
(
d
=
(
1
-
(
this
.
geometry
.
skinWeights
[
b
].
x
+
this
.
geometry
.
skinWeights
[
b
].
y
))
*
0.5
,
this
.
geometry
.
skinWeights
[
b
].
x
+=
d
,
this
.
geometry
.
skinWeights
[
b
].
y
+=
d
)}}};
THREE
.
Ribbon
=
function
(
b
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
b
;
this
.
materials
=
c
instanceof
Array
?
c
:[
c
]};
THREE
.
Ribbon
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Ribbon
.
prototype
.
constructor
=
THREE
.
Ribbon
;
THREE
.
LOD
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
LODs
=
[]};
THREE
.
LOD
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
LOD
.
prototype
.
constructor
=
THREE
.
LOD
;
THREE
.
LOD
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
LOD
.
prototype
.
add
=
function
(
b
,
c
){
c
===
void
0
&&
(
c
=
0
);
for
(
var
c
=
Math
.
abs
(
c
),
d
=
0
;
d
<
this
.
LODs
.
length
;
d
++
)
if
(
c
<
this
.
LODs
[
d
].
visibleAtDistance
)
break
;
this
.
LODs
.
splice
(
d
,
0
,{
visibleAtDistance
:
c
,
object3D
:
b
});
this
.
addChil
d
(
b
)};
THREE
.
Ribbon
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Ribbon
.
prototype
.
constructor
=
THREE
.
Ribbon
;
THREE
.
LOD
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
LODs
=
[]};
THREE
.
LOD
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
LOD
.
prototype
.
constructor
=
THREE
.
LOD
;
THREE
.
LOD
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
LOD
.
prototype
.
add
Level
=
function
(
b
,
c
){
c
===
void
0
&&
(
c
=
0
);
for
(
var
c
=
Math
.
abs
(
c
),
d
=
0
;
d
<
this
.
LODs
.
length
;
d
++
)
if
(
c
<
this
.
LODs
[
d
].
visibleAtDistance
)
break
;
this
.
LODs
.
splice
(
d
,
0
,{
visibleAtDistance
:
c
,
object3D
:
b
});
this
.
ad
d
(
b
)};
THREE
.
LOD
.
prototype
.
update
=
function
(
b
,
c
,
d
){
this
.
matrixAutoUpdate
&&
(
c
|=
this
.
updateMatrix
());
if
(
c
||
this
.
matrixWorldNeedsUpdate
)
b
?
this
.
matrixWorld
.
multiply
(
b
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
),
this
.
matrixWorldNeedsUpdate
=!
1
,
c
=!
0
;
if
(
this
.
LODs
.
length
>
1
){
b
=
d
.
matrixWorldInverse
;
b
=-
(
b
.
n31
*
this
.
position
.
x
+
b
.
n32
*
this
.
position
.
y
+
b
.
n33
*
this
.
position
.
z
+
b
.
n34
);
this
.
LODs
[
0
].
object3D
.
visible
=!
0
;
for
(
var
e
=
1
;
e
<
this
.
LODs
.
length
;
e
++
)
if
(
b
>=
this
.
LODs
[
e
].
visibleAtDistance
)
this
.
LODs
[
e
-
1
].
object3D
.
visible
=!
1
,
this
.
LODs
[
e
].
object3D
.
visible
=!
0
;
else
break
;
for
(;
e
<
this
.
LODs
.
length
;
e
++
)
this
.
LODs
[
e
].
object3D
.
visible
=!
1
}
for
(
b
=
0
;
b
<
this
.
children
.
length
;
b
++
)
this
.
children
[
b
].
update
(
this
.
matrixWorld
,
c
,
d
)};
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
;
...
...
examples/webgl_lod.html
浏览文件 @
f105cbb7
...
...
@@ -104,7 +104,7 @@
mesh
.
scale
.
set
(
1.5
,
1.5
,
1.5
);
mesh
.
updateMatrix
();
mesh
.
matrixAutoUpdate
=
false
;
lod
.
add
(
mesh
,
geometry
[
i
][
1
]
);
lod
.
add
Level
(
mesh
,
geometry
[
i
][
1
]
);
}
...
...
examples/webgl_lod_text.html
浏览文件 @
f105cbb7
...
...
@@ -145,7 +145,7 @@
mesh
.
scale
.
set
(
1.5
,
1.5
,
1.5
);
mesh
.
updateMatrix
();
mesh
.
matrixAutoUpdate
=
false
;
lod
.
add
(
mesh
,
geometry
[
i
][
1
]
);
lod
.
add
Level
(
mesh
,
geometry
[
i
][
1
]
);
}
...
...
src/objects/LOD.js
浏览文件 @
f105cbb7
...
...
@@ -18,7 +18,7 @@ THREE.LOD.prototype.supr = THREE.Object3D.prototype;
* Add
*/
THREE
.
LOD
.
prototype
.
add
=
function
(
object3D
,
visibleAtDistance
)
{
THREE
.
LOD
.
prototype
.
add
Level
=
function
(
object3D
,
visibleAtDistance
)
{
if
(
visibleAtDistance
===
undefined
)
{
...
...
@@ -39,7 +39,7 @@ THREE.LOD.prototype.add = function ( object3D, visibleAtDistance ) {
}
this
.
LODs
.
splice
(
l
,
0
,
{
visibleAtDistance
:
visibleAtDistance
,
object3D
:
object3D
}
);
this
.
add
Child
(
object3D
);
this
.
add
(
object3D
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录