Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3e4339f3
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
3e4339f3
编写于
11月 14, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added handling of MeshFaceMaterial.materials to scene format / SceneLoader.
See #2628 and #2623
上级
6fb5b91c
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
197 addition
and
107 deletion
+197
-107
build/three.js
build/three.js
+31
-3
build/three.min.js
build/three.min.js
+102
-101
examples/scenes/test_scene.js
examples/scenes/test_scene.js
+33
-0
src/loaders/BinaryLoader.js
src/loaders/BinaryLoader.js
+4
-2
src/loaders/JSONLoader.js
src/loaders/JSONLoader.js
+3
-1
src/loaders/SceneLoader.js
src/loaders/SceneLoader.js
+24
-0
未找到文件。
build/three.js
浏览文件 @
3e4339f3
...
...
@@ -7221,8 +7221,10 @@ THREE.BinaryLoader.prototype = Object.create( THREE.Loader.prototype );
THREE.BinaryLoader.prototype.load = function( url, callback, texturePath, binaryPath ) {
texturePath = texturePath ? texturePath : this.extractUrlBase( url );
binaryPath = binaryPath ? binaryPath : this.extractUrlBase( url );
// todo: unify load API to for easier SceneLoader use
texturePath = texturePath && ( typeof texturePath === "string" ) ? texturePath : this.extractUrlBase( url );
binaryPath = binaryPath && ( typeof binaryPath === "string" ) ? binaryPath : this.extractUrlBase( url );
var callbackProgress = this.showProgress ? THREE.Loader.prototype.updateProgress : null;
...
...
@@ -8024,7 +8026,9 @@ THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
var scope = this;
texturePath = texturePath ? texturePath : this.extractUrlBase( url );
// todo: unify load API to for easier SceneLoader use
texturePath = texturePath && ( typeof texturePath === "string" ) ? texturePath : this.extractUrlBase( url );
this.onLoadStart();
this.loadAjaxJSON( this, url, callback, texturePath );
...
...
@@ -10227,6 +10231,30 @@ THREE.SceneLoader.prototype.parse = function ( json, callbackFinished, url ) {
}
// second pass through all materials to initialize MeshFaceMaterials
// that could be referring to other materials out of order
for ( dm in data.materials ) {
m = data.materials[ dm ];
if ( m.parameters.materials ) {
var materialArray = [];
for ( var i = 0; i < m.parameters.materials.length; i ++ ) {
var label = m.parameters.materials[ i ];
materialArray.push( result.materials[ label ] );
}
result.materials[ dm ].materials = materialArray;
}
}
// objects ( synchronous init of procedural primitives )
handle_objects();
...
...
build/three.min.js
浏览文件 @
3e4339f3
此差异已折叠。
点击以展开。
examples/scenes/test_scene.js
浏览文件 @
3e4339f3
...
...
@@ -211,6 +211,24 @@
"
visible
"
:
true
},
"
man_clone_1
"
:
{
"
geometry
"
:
"
man
"
,
"
material
"
:
"
multi_1
"
,
"
position
"
:
[
2.5
,
-
10
,
-
25
],
"
rotation
"
:
[
0
,
0
,
0
],
"
scale
"
:
[
0.2
,
0.2
,
0.2
],
"
visible
"
:
true
},
"
man_clone_2
"
:
{
"
geometry
"
:
"
man
"
,
"
material
"
:
"
multi_2
"
,
"
position
"
:
[
15
,
-
10
,
-
25
],
"
rotation
"
:
[
0
,
0
,
0
],
"
scale
"
:
[
0.2
,
0.2
,
0.2
],
"
visible
"
:
true
},
"
monster
"
:
{
"
type
"
:
"
dae
"
,
"
url
"
:
"
models/collada/monster/monster.dae
"
,
...
...
@@ -451,6 +469,11 @@
"
url
"
:
"
models/skinned/knight.js
"
},
"
man
"
:
{
"
type
"
:
"
binary
"
,
"
url
"
:
"
obj/male02/Male02_bin.js
"
},
"
ben
"
:
{
"
type
"
:
"
ctm
"
,
"
url
"
:
"
models/ctm/ben.ctm
"
,
...
...
@@ -663,6 +686,16 @@
"
face
"
:
{
"
type
"
:
"
MeshFaceMaterial
"
,
"
parameters
"
:
{}
},
"
multi_1
"
:
{
"
type
"
:
"
MeshFaceMaterial
"
,
"
parameters
"
:
{}
},
"
multi_2
"
:
{
"
type
"
:
"
MeshFaceMaterial
"
,
"
parameters
"
:
{
"
materials
"
:
[
"
phong_compressed_cube
"
,
"
phong_man
"
,
"
phong_hand
"
,
"
minecraft
"
,
"
backsignals
"
]
}
}
},
...
...
src/loaders/BinaryLoader.js
浏览文件 @
3e4339f3
...
...
@@ -20,8 +20,10 @@ THREE.BinaryLoader.prototype = Object.create( THREE.Loader.prototype );
THREE
.
BinaryLoader
.
prototype
.
load
=
function
(
url
,
callback
,
texturePath
,
binaryPath
)
{
texturePath
=
texturePath
?
texturePath
:
this
.
extractUrlBase
(
url
);
binaryPath
=
binaryPath
?
binaryPath
:
this
.
extractUrlBase
(
url
);
// todo: unify load API to for easier SceneLoader use
texturePath
=
texturePath
&&
(
typeof
texturePath
===
"
string
"
)
?
texturePath
:
this
.
extractUrlBase
(
url
);
binaryPath
=
binaryPath
&&
(
typeof
binaryPath
===
"
string
"
)
?
binaryPath
:
this
.
extractUrlBase
(
url
);
var
callbackProgress
=
this
.
showProgress
?
THREE
.
Loader
.
prototype
.
updateProgress
:
null
;
...
...
src/loaders/JSONLoader.js
浏览文件 @
3e4339f3
...
...
@@ -17,7 +17,9 @@ THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
var
scope
=
this
;
texturePath
=
texturePath
?
texturePath
:
this
.
extractUrlBase
(
url
);
// todo: unify load API to for easier SceneLoader use
texturePath
=
texturePath
&&
(
typeof
texturePath
===
"
string
"
)
?
texturePath
:
this
.
extractUrlBase
(
url
);
this
.
onLoadStart
();
this
.
loadAjaxJSON
(
this
,
url
,
callback
,
texturePath
);
...
...
src/loaders/SceneLoader.js
浏览文件 @
3e4339f3
...
...
@@ -1066,6 +1066,30 @@ THREE.SceneLoader.prototype.parse = function ( json, callbackFinished, url ) {
}
// second pass through all materials to initialize MeshFaceMaterials
// that could be referring to other materials out of order
for
(
dm
in
data
.
materials
)
{
m
=
data
.
materials
[
dm
];
if
(
m
.
parameters
.
materials
)
{
var
materialArray
=
[];
for
(
var
i
=
0
;
i
<
m
.
parameters
.
materials
.
length
;
i
++
)
{
var
label
=
m
.
parameters
.
materials
[
i
];
materialArray
.
push
(
result
.
materials
[
label
]
);
}
result
.
materials
[
dm
].
materials
=
materialArray
;
}
}
// objects ( synchronous init of procedural primitives )
handle_objects
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录