Skip to content

Commit a982695

Browse files
committed
Implemented gltf-model-loading
1 parent 7622f2a commit a982695

80 files changed

Lines changed: 4695 additions & 53 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/models/box/Box.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type: Model
2+
version: 1
3+
source: models/box/BoxTextured.gltf

assets/models/box/BoxTextured.gltf

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"asset": {
3+
"generator": "COLLADA2GLTF",
4+
"version": "2.0"
5+
},
6+
"scene": 0,
7+
"scenes": [
8+
{
9+
"nodes": [
10+
0
11+
]
12+
}
13+
],
14+
"nodes": [
15+
{
16+
"children": [
17+
1
18+
],
19+
"matrix": [
20+
1.0,
21+
0.0,
22+
0.0,
23+
0.0,
24+
0.0,
25+
0.0,
26+
-1.0,
27+
0.0,
28+
0.0,
29+
1.0,
30+
0.0,
31+
0.0,
32+
0.0,
33+
0.0,
34+
0.0,
35+
1.0
36+
]
37+
},
38+
{
39+
"mesh": 0
40+
}
41+
],
42+
"meshes": [
43+
{
44+
"primitives": [
45+
{
46+
"attributes": {
47+
"NORMAL": 1,
48+
"POSITION": 2,
49+
"TEXCOORD_0": 3
50+
},
51+
"indices": 0,
52+
"mode": 4,
53+
"material": 0
54+
}
55+
],
56+
"name": "Mesh"
57+
}
58+
],
59+
"accessors": [
60+
{
61+
"bufferView": 0,
62+
"byteOffset": 0,
63+
"componentType": 5123,
64+
"count": 36,
65+
"max": [
66+
23
67+
],
68+
"min": [
69+
0
70+
],
71+
"type": "SCALAR"
72+
},
73+
{
74+
"bufferView": 1,
75+
"byteOffset": 0,
76+
"componentType": 5126,
77+
"count": 24,
78+
"max": [
79+
1.0,
80+
1.0,
81+
1.0
82+
],
83+
"min": [
84+
-1.0,
85+
-1.0,
86+
-1.0
87+
],
88+
"type": "VEC3"
89+
},
90+
{
91+
"bufferView": 1,
92+
"byteOffset": 288,
93+
"componentType": 5126,
94+
"count": 24,
95+
"max": [
96+
0.5,
97+
0.5,
98+
0.5
99+
],
100+
"min": [
101+
-0.5,
102+
-0.5,
103+
-0.5
104+
],
105+
"type": "VEC3"
106+
},
107+
{
108+
"bufferView": 2,
109+
"byteOffset": 0,
110+
"componentType": 5126,
111+
"count": 24,
112+
"max": [
113+
6.0,
114+
1.0
115+
],
116+
"min": [
117+
0.0,
118+
0.0
119+
],
120+
"type": "VEC2"
121+
}
122+
],
123+
"materials": [
124+
{
125+
"pbrMetallicRoughness": {
126+
"baseColorTexture": {
127+
"index": 0
128+
},
129+
"metallicFactor": 0.0
130+
},
131+
"name": "Texture"
132+
}
133+
],
134+
"textures": [
135+
{
136+
"sampler": 0,
137+
"source": 0
138+
}
139+
],
140+
"images": [
141+
{
142+
"uri": "CesiumLogoFlat.png"
143+
}
144+
],
145+
"samplers": [
146+
{
147+
"magFilter": 9729,
148+
"minFilter": 9986,
149+
"wrapS": 10497,
150+
"wrapT": 10497
151+
}
152+
],
153+
"bufferViews": [
154+
{
155+
"buffer": 0,
156+
"byteOffset": 768,
157+
"byteLength": 72,
158+
"target": 34963
159+
},
160+
{
161+
"buffer": 0,
162+
"byteOffset": 0,
163+
"byteLength": 576,
164+
"byteStride": 12,
165+
"target": 34962
166+
},
167+
{
168+
"buffer": 0,
169+
"byteOffset": 576,
170+
"byteLength": 192,
171+
"byteStride": 8,
172+
"target": 34962
173+
}
174+
],
175+
"buffers": [
176+
{
177+
"byteLength": 840,
178+
"uri": "BoxTextured0.bin"
179+
}
180+
]
181+
}

assets/models/box/BoxTextured0.bin

840 Bytes
Binary file not shown.
3.66 KB
Loading
545 KB
Binary file not shown.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"accessors" : [
3+
{
4+
"bufferView" : 0,
5+
"componentType" : 5123,
6+
"count" : 46356,
7+
"max" : [
8+
14555
9+
],
10+
"min" : [
11+
0
12+
],
13+
"type" : "SCALAR"
14+
},
15+
{
16+
"bufferView" : 1,
17+
"componentType" : 5126,
18+
"count" : 14556,
19+
"max" : [
20+
0.9424954056739807,
21+
0.8128451108932495,
22+
0.900973916053772
23+
],
24+
"min" : [
25+
-0.9474585652351379,
26+
-1.18715500831604,
27+
-0.9009949564933777
28+
],
29+
"type" : "VEC3"
30+
},
31+
{
32+
"bufferView" : 2,
33+
"componentType" : 5126,
34+
"count" : 14556,
35+
"max" : [
36+
1.0,
37+
1.0,
38+
1.0
39+
],
40+
"min" : [
41+
-1.0,
42+
-1.0,
43+
-1.0
44+
],
45+
"type" : "VEC3"
46+
},
47+
{
48+
"bufferView" : 3,
49+
"componentType" : 5126,
50+
"count" : 14556,
51+
"max" : [
52+
0.9999759793281555,
53+
1.998665988445282
54+
],
55+
"min" : [
56+
0.002448640065267682,
57+
1.0005531199858524
58+
],
59+
"type" : "VEC2"
60+
}
61+
],
62+
"asset" : {
63+
"generator" : "Khronos Blender glTF 2.0 exporter",
64+
"version" : "2.0"
65+
},
66+
"bufferViews" : [
67+
{
68+
"buffer" : 0,
69+
"byteLength" : 92712,
70+
"byteOffset" : 0,
71+
"target" : 34963
72+
},
73+
{
74+
"buffer" : 0,
75+
"byteLength" : 174672,
76+
"byteOffset" : 92712,
77+
"target" : 34962
78+
},
79+
{
80+
"buffer" : 0,
81+
"byteLength" : 174672,
82+
"byteOffset" : 267384,
83+
"target" : 34962
84+
},
85+
{
86+
"buffer" : 0,
87+
"byteLength" : 116448,
88+
"byteOffset" : 442056,
89+
"target" : 34962
90+
}
91+
],
92+
"buffers" : [
93+
{
94+
"byteLength" : 558504,
95+
"uri" : "DamagedHelmet.bin"
96+
}
97+
],
98+
"images" : [
99+
{
100+
"uri" : "Default_albedo.jpg"
101+
},
102+
{
103+
"uri" : "Default_metalRoughness.jpg"
104+
},
105+
{
106+
"uri" : "Default_emissive.jpg"
107+
},
108+
{
109+
"uri" : "Default_AO.jpg"
110+
},
111+
{
112+
"uri" : "Default_normal.jpg"
113+
}
114+
],
115+
"materials" : [
116+
{
117+
"emissiveFactor" : [
118+
1.0,
119+
1.0,
120+
1.0
121+
],
122+
"emissiveTexture" : {
123+
"index" : 2
124+
},
125+
"name" : "Material_MR",
126+
"normalTexture" : {
127+
"index" : 4
128+
},
129+
"occlusionTexture" : {
130+
"index" : 3
131+
},
132+
"pbrMetallicRoughness" : {
133+
"baseColorTexture" : {
134+
"index" : 0
135+
},
136+
"metallicRoughnessTexture" : {
137+
"index" : 1
138+
}
139+
}
140+
}
141+
],
142+
"meshes" : [
143+
{
144+
"name" : "mesh_helmet_LP_13930damagedHelmet",
145+
"primitives" : [
146+
{
147+
"attributes" : {
148+
"NORMAL" : 2,
149+
"POSITION" : 1,
150+
"TEXCOORD_0" : 3
151+
},
152+
"indices" : 0,
153+
"material" : 0
154+
}
155+
]
156+
}
157+
],
158+
"nodes" : [
159+
{
160+
"mesh" : 0,
161+
"name" : "node_damagedHelmet_-6514",
162+
"rotation" : [
163+
0.7071068286895752,
164+
0.0,
165+
-0.0,
166+
0.7071068286895752
167+
]
168+
}
169+
],
170+
"samplers" : [
171+
{}
172+
],
173+
"scene" : 0,
174+
"scenes" : [
175+
{
176+
"name" : "Scene",
177+
"nodes" : [
178+
0
179+
]
180+
}
181+
],
182+
"textures" : [
183+
{
184+
"sampler" : 0,
185+
"source" : 0
186+
},
187+
{
188+
"sampler" : 0,
189+
"source" : 1
190+
},
191+
{
192+
"sampler" : 0,
193+
"source" : 2
194+
},
195+
{
196+
"sampler" : 0,
197+
"source" : 3
198+
},
199+
{
200+
"sampler" : 0,
201+
"source" : 4
202+
}
203+
]
204+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type: Model
2+
version: 1
3+
source: models/damaged-helmet/DamagedHelmet.gltf
353 KB
Loading
914 KB
Loading
95.2 KB
Loading

0 commit comments

Comments
 (0)