Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
fe3b5e55
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,发现更多精彩内容 >>
提交
fe3b5e55
编写于
12月 08, 2016
作者:
K
Kyle Larson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prep for changing material application
上级
7a32d5f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
23 deletion
+49
-23
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+48
-18
examples/webgl_loader_fbx.html
examples/webgl_loader_fbx.html
+1
-5
未找到文件。
examples/js/loaders/FBXLoader.js
浏览文件 @
fe3b5e55
...
...
@@ -273,7 +273,7 @@
case
"
phong
"
:
tmpMat
=
new
THREE
.
MeshPhongMaterial
();
break
;
case
"
L
ambert
"
:
case
"
l
ambert
"
:
tmpMat
=
new
THREE
.
MeshLambertMaterial
();
break
;
default
:
...
...
@@ -303,7 +303,7 @@
material
=
new
THREE
.
MultiMaterial
(
materials
);
var
material_groupings
=
[];
var
last_material_group
=
-
1
;
var
material_index_list
=
parseArrayToInt
(
node
.
subNodes
.
LayerElementMaterial
.
subNodes
.
Materials
.
properties
.
a
);
var
material_index_list
=
parseArrayToInt
(
node
.
subNodes
.
LayerElementMaterial
[
0
]
.
subNodes
.
Materials
.
properties
.
a
);
for
(
var
i
=
0
;
i
<
geo
.
polyIndices
.
length
;
++
i
)
{
if
(
last_material_group
!==
material_index_list
[
geo
.
polyIndices
[
i
]
]
)
{
...
...
@@ -2561,14 +2561,19 @@
}
this
.
stacks
[
key
]
=
{
//Do we have an animation clip with an actual length?
if
(
max
>
min
)
{
name
:
rawStacks
[
key
].
attrName
,
layers
:
layers
,
length
:
max
-
min
,
frames
:
(
max
-
min
)
*
30
,
this
.
stacks
[
key
]
=
{
};
name
:
rawStacks
[
key
].
attrName
,
layers
:
layers
,
length
:
max
-
min
,
frames
:
(
max
-
min
)
*
30
,
};
}
}
...
...
@@ -2762,21 +2767,46 @@
//TODO: Missing parameters:
// - Ambient
// - AmbientColor
// - (Diffuse?) Using DiffuseColor, which has same value, so I dunno.
// - (Emissive?) Same as above)
// - MultiLayer
// - ShininessExponent (Same vals as Shininess)
// - Specular (Same vals as SpecularColor)
// - TransparencyFactor (Maybe same as Opacity?).
parameters
.
color
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
DiffuseColor
.
value
.
x
),
parseFloat
(
properties
.
DiffuseColor
.
value
.
y
),
parseFloat
(
properties
.
DiffuseColor
.
value
.
z
)
]
);
parameters
.
specular
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
SpecularColor
.
value
.
x
),
parseFloat
(
properties
.
SpecularColor
.
value
.
y
),
parseFloat
(
properties
.
SpecularColor
.
value
.
z
)
]
);
parameters
.
shininess
=
properties
.
Shininess
.
value
;
parameters
.
emissive
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
EmissiveColor
.
value
.
x
),
parseFloat
(
properties
.
EmissiveColor
.
value
.
y
),
parseFloat
(
properties
.
EmissiveColor
.
value
.
z
)
]
);
parameters
.
emissiveIntensity
=
properties
.
EmissiveFactor
.
value
;
parameters
.
reflectivity
=
properties
.
Reflectivity
.
value
;
parameters
.
opacity
=
properties
.
Opacity
.
value
;
if
(
properties
.
Diffuse
)
{
parameters
.
color
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
Diffuse
.
value
.
x
),
parseFloat
(
properties
.
Diffuse
.
value
.
y
),
parseFloat
(
properties
.
Diffuse
.
value
.
z
)
]
);
}
if
(
properties
.
Specular
)
{
parameters
.
specular
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
Specular
.
value
.
x
),
parseFloat
(
properties
.
Specular
.
value
.
y
),
parseFloat
(
properties
.
Specular
.
value
.
z
)
]
);
}
if
(
properties
.
Shininess
)
{
parameters
.
shininess
=
properties
.
Shininess
.
value
;
}
if
(
properties
.
Emissive
)
{
parameters
.
emissive
=
new
THREE
.
Color
().
fromArray
(
[
parseFloat
(
properties
.
Emissive
.
value
.
x
),
parseFloat
(
properties
.
Emissive
.
value
.
y
),
parseFloat
(
properties
.
Emissive
.
value
.
z
)
]
);
}
if
(
properties
.
EmissiveFactor
)
{
parameters
.
emissiveIntensity
=
properties
.
EmissiveFactor
.
value
;
}
if
(
properties
.
Reflectivity
)
{
parameters
.
reflectivity
=
properties
.
Reflectivity
.
value
;
}
if
(
properties
.
Opacity
)
{
parameters
.
opacity
=
properties
.
Opacity
.
value
;
}
if
(
parameters
.
opacity
<
1.0
)
{
parameters
.
transparent
=
true
;
...
...
examples/webgl_loader_fbx.html
浏览文件 @
fe3b5e55
...
...
@@ -61,10 +61,6 @@
scene
=
new
THREE
.
Scene
();
lights
=
new
THREE
.
DirectionalLight
();
lights
.
position
.
set
(
0
,
5
,
0
);
scene
.
add
(
lights
);
// grid
var
gridHelper
=
new
THREE
.
GridHelper
(
14
,
28
,
0x303030
,
0x303030
);
gridHelper
.
position
.
set
(
0
,
-
0.04
,
0
);
...
...
@@ -114,7 +110,7 @@
child
.
mixer
=
new
THREE
.
AnimationMixer
(
child
);
mixers
.
push
(
child
.
mixer
);
var
action
=
child
.
mixer
.
clipAction
(
child
.
geometry
.
animations
[
1
]
);
var
action
=
child
.
mixer
.
clipAction
(
child
.
geometry
.
animations
[
0
]
);
action
.
play
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录