Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
cace4146
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,发现更多精彩内容 >>
提交
cace4146
编写于
6月 09, 2017
作者:
D
Don McCurdy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add lights to duck example for good measure.
上级
17a7749b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
9 deletion
+84
-9
examples/js/loaders/GLTF2Loader.js
examples/js/loaders/GLTF2Loader.js
+2
-2
examples/models/gltf/Duck/glTF-MaterialsCommon/Duck.gltf
examples/models/gltf/Duck/glTF-MaterialsCommon/Duck.gltf
+80
-5
examples/webgl_loader_gltf2.html
examples/webgl_loader_gltf2.html
+2
-2
未找到文件。
examples/js/loaders/GLTF2Loader.js
浏览文件 @
cace4146
...
...
@@ -310,8 +310,7 @@ THREE.GLTF2Loader = ( function () {
var
light
=
lights
[
lightId
];
var
lightNode
;
var
lightParams
=
light
[
light
.
type
];
var
color
=
new
THREE
.
Color
().
fromArray
(
lightParams
.
color
);
var
color
=
new
THREE
.
Color
().
fromArray
(
light
.
color
);
switch
(
light
.
type
)
{
...
...
@@ -337,6 +336,7 @@ THREE.GLTF2Loader = ( function () {
if
(
lightNode
)
{
lightNode
.
name
=
light
.
name
||
(
'
light_
'
+
lightId
);
this
.
lights
[
lightId
]
=
lightNode
;
}
...
...
examples/models/gltf/Duck/glTF-MaterialsCommon/Duck.gltf
浏览文件 @
cace4146
...
...
@@ -141,11 +141,47 @@
"type" : "perspective"
}
],
"extensions" : {
"KHR_lights" : {
"lights" : [
{
"color" : [
1.0,
1.0,
1.0
],
"name" : "directionalLightShape1",
"type" : "directional"
},
{
"color" : [
1.0,
1.0,
1.0
],
"name" : "Lamp",
"quadraticAttenuation" : 0.03333335240683057,
"type" : "point"
},
{
"color" : [
0.0,
0.0,
0.0
],
"name" : "Ambient_Scene",
"type" : "ambient"
}
]
}
},
"extensionsRequired" : [
"KHR_materials_common"
"KHR_materials_common",
"KHR_lights"
],
"extensionsUsed" : [
"KHR_materials_common"
"KHR_materials_common",
"KHR_lights"
],
"images" : [
{
...
...
@@ -266,6 +302,23 @@
]
},
{
"extensions" : {
"KHR_lights" : {
"light" : 0
}
},
"name" : "Correction_directionalLight1",
"rotation" : [
-0.7071067690849304,
-0.0,
0.0,
0.7071067690849304
]
},
{
"children" : [
4
],
"name" : "directionalLight1",
"rotation" : [
0.14142043888568878,
...
...
@@ -285,6 +338,23 @@
]
},
{
"extensions" : {
"KHR_lights" : {
"light" : 1
}
},
"name" : "Correction_Lamp",
"rotation" : [
-0.7071067690849304,
-0.0,
0.0,
0.7071067690849304
]
},
{
"children" : [
6
],
"name" : "Lamp",
"rotation" : [
0.16907575726509094,
...
...
@@ -325,12 +395,17 @@
"scene" : 0,
"scenes" : [
{
"extensions" : {
"KHR_lights" : {
"light" : 2
}
},
"name" : "Scene",
"nodes" : [
4,
3,
6,
5,
3,
8,
7,
1
]
}
...
...
examples/webgl_loader_gltf2.html
浏览文件 @
cace4146
...
...
@@ -437,8 +437,8 @@
addLights
:
true
,
addGround
:
true
,
shadows
:
true
,
// TODO: 'glTF-
MaterialsCommon', 'glTF-
techniqueWebGL'
extensions
:
[
'
glTF
'
,
'
glTF-Embedded
'
,
'
glTF-pbrSpecularGlossiness
'
,
'
glTF-Binary
'
]
// TODO: 'glTF-techniqueWebGL'
extensions
:
[
'
glTF
'
,
'
glTF-Embedded
'
,
'
glTF-
MaterialsCommon
'
,
'
glTF-
pbrSpecularGlossiness
'
,
'
glTF-Binary
'
]
},
{
name
:
"
Monster
"
,
url
:
"
./models/gltf/Monster/%s/Monster.gltf
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录