Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7895397c
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,发现更多精彩内容 >>
提交
7895397c
编写于
12月 15, 2016
作者:
S
Steven Wittens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Parse out extras as Object3D.userData for scene, camera, node, mesh, primitive
- Add extras properties to duck.gltf
上级
5a24dac5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
12 deletion
+57
-12
examples/js/loaders/GLTFLoader.js
examples/js/loaders/GLTFLoader.js
+9
-0
examples/models/gltf/duck/glTF-MaterialsCommon/duck.gltf
examples/models/gltf/duck/glTF-MaterialsCommon/duck.gltf
+24
-6
examples/models/gltf/duck/glTF/duck.gltf
examples/models/gltf/duck/glTF/duck.gltf
+24
-6
未找到文件。
examples/js/loaders/GLTFLoader.js
浏览文件 @
7895397c
...
...
@@ -1153,6 +1153,7 @@ THREE.GLTFLoader = ( function () {
var
group
=
new
THREE
.
Object3D
();
group
.
name
=
mesh
.
name
;
group
.
userData
=
mesh
.
extras
||
{};
var
primitives
=
mesh
.
primitives
;
...
...
@@ -1225,6 +1226,7 @@ THREE.GLTFLoader = ( function () {
var
meshNode
=
new
THREE
.
Mesh
(
geometry
,
material
);
meshNode
.
castShadow
=
true
;
meshNode
.
userData
=
primitive
.
extras
||
{};
group
.
add
(
meshNode
);
...
...
@@ -1266,6 +1268,7 @@ THREE.GLTFLoader = ( function () {
var
_camera
=
new
THREE
.
PerspectiveCamera
(
THREE
.
Math
.
radToDeg
(
xfov
),
aspect_ratio
,
camera
.
perspective
.
znear
||
1
,
camera
.
perspective
.
zfar
||
2
e6
);
_camera
.
name
=
camera
.
name
;
_camera
.
userData
=
camera
.
extras
||
{};
return
_camera
;
...
...
@@ -1273,6 +1276,7 @@ THREE.GLTFLoader = ( function () {
var
_camera
=
new
THREE
.
OrthographicCamera
(
window
.
innerWidth
/
-
2
,
window
.
innerWidth
/
2
,
window
.
innerHeight
/
2
,
window
.
innerHeight
/
-
2
,
camera
.
orthographic
.
znear
,
camera
.
orthographic
.
zfar
);
_camera
.
name
=
camera
.
name
;
_camera
.
userData
=
camera
.
extras
||
{};
return
_camera
;
...
...
@@ -1389,6 +1393,7 @@ THREE.GLTFLoader = ( function () {
}
_node
.
name
=
node
.
name
;
_node
.
userData
=
node
.
extras
||
{};
_node
.
matrixAutoUpdate
=
false
;
...
...
@@ -1451,6 +1456,7 @@ THREE.GLTFLoader = ( function () {
var
originalMaterial
=
child
.
material
;
var
originalGeometry
=
child
.
geometry
;
var
originalUserData
=
child
.
userData
;
var
material
;
...
...
@@ -1466,6 +1472,7 @@ THREE.GLTFLoader = ( function () {
child
=
new
THREE
.
Mesh
(
originalGeometry
,
material
);
child
.
castShadow
=
true
;
child
.
userData
=
originalUserData
;
var
skinEntry
;
...
...
@@ -1484,6 +1491,7 @@ THREE.GLTFLoader = ( function () {
child
=
new
THREE
.
SkinnedMesh
(
geometry
,
material
,
false
);
child
.
castShadow
=
true
;
child
.
userData
=
originalUserData
;
var
bones
=
[];
var
boneInverses
=
[];
...
...
@@ -1666,6 +1674,7 @@ THREE.GLTFLoader = ( function () {
var
_scene
=
new
THREE
.
Scene
();
_scene
.
name
=
scene
.
name
;
_scene
.
userData
=
scene
.
extras
||
{};
var
nodes
=
scene
.
nodes
;
...
...
examples/models/gltf/duck/glTF-MaterialsCommon/duck.gltf
浏览文件 @
7895397c
...
...
@@ -177,9 +177,15 @@
},
"indices": "accessor_21",
"material": "blinn3-fx",
"mode": 4
"mode": 4,
"extras": {
"foo": "primitive"
}
}
]
],
"extras": {
"foo": "mesh"
}
}
},
"nodes": {
...
...
@@ -206,7 +212,10 @@
"meshes": [
"LOD3spShape-lib"
],
"name": "LOD3sp"
"name": "LOD3sp",
"extras": {
"foo": "node"
}
},
"camera1": {
"camera": "cameraShape1",
...
...
@@ -229,7 +238,10 @@
-4.31078,
1
],
"name": "camera1"
"name": "camera1",
"extras": {
"foo": "camera"
}
},
"directionalLight1": {
"children": [],
...
...
@@ -256,7 +268,10 @@
-2.92179,
1
],
"name": "directionalLight1"
"name": "directionalLight1",
"extras": {
"foo": "light"
}
}
},
"samplers": {
...
...
@@ -274,7 +289,10 @@
"LOD3sp",
"camera1",
"directionalLight1"
]
],
"extras": {
"foo": "scene"
}
}
},
"skins": {},
...
...
examples/models/gltf/duck/glTF/duck.gltf
浏览文件 @
7895397c
...
...
@@ -150,9 +150,15 @@
},
"indices": "accessor_21",
"material": "blinn3-fx",
"mode": 4
"mode": 4,
"extras": {
"foo": "primitive"
}
}
]
],
"extras": {
"foo": "mesh"
}
}
},
"nodes": {
...
...
@@ -179,7 +185,10 @@
"meshes": [
"LOD3spShape-lib"
],
"name": "LOD3sp"
"name": "LOD3sp",
"extras": {
"foo": "node"
}
},
"camera1": {
"camera": "cameraShape1",
...
...
@@ -202,7 +211,10 @@
-4.31078,
1
],
"name": "camera1"
"name": "camera1",
"extras": {
"foo": "camera"
}
},
"directionalLight1": {
"children": [],
...
...
@@ -224,7 +236,10 @@
-2.92179,
1
],
"name": "directionalLight1"
"name": "directionalLight1",
"extras": {
"foo": "light"
}
}
},
"programs": {
...
...
@@ -253,7 +268,10 @@
"LOD3sp",
"camera1",
"directionalLight1"
]
],
"extras": {
"foo": "scene"
}
}
},
"shaders": {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录