Skip to content

Commit 69d4fc4

Browse files
committed
add example showing gltf animations
1 parent 17f40c9 commit 69d4fc4

File tree

6 files changed

+1233
-0
lines changed

6 files changed

+1233
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ path = "examples/3d/lighting.rs"
164164
name = "load_gltf"
165165
path = "examples/3d/load_gltf.rs"
166166

167+
[[example]]
168+
name = "load_gltf_animation"
169+
path = "examples/3d/load_gltf_animation.rs"
170+
167171
[[example]]
168172
name = "many_cubes"
169173
path = "examples/3d/many_cubes.rs"
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"scene" : 0,
3+
"scenes" : [
4+
{
5+
"nodes" : [ 0 ]
6+
}
7+
],
8+
9+
"nodes" : [
10+
{
11+
"mesh" : 0,
12+
"rotation" : [ 0.0, 0.0, 0.0, 1.0 ]
13+
}
14+
],
15+
16+
"meshes" : [
17+
{
18+
"primitives" : [ {
19+
"attributes" : {
20+
"POSITION" : 1
21+
},
22+
"indices" : 0
23+
} ]
24+
}
25+
],
26+
27+
"animations": [
28+
{
29+
"samplers" : [
30+
{
31+
"input" : 2,
32+
"interpolation" : "LINEAR",
33+
"output" : 3
34+
}
35+
],
36+
"channels" : [ {
37+
"sampler" : 0,
38+
"target" : {
39+
"node" : 0,
40+
"path" : "rotation"
41+
}
42+
} ]
43+
}
44+
],
45+
46+
"buffers" : [
47+
{
48+
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=",
49+
"byteLength" : 44
50+
},
51+
{
52+
"uri" : "data:application/octet-stream;base64,AAAAAAAAgD4AAAA/AABAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAPT9ND/0/TS/AAAAAAAAAAAAAAAAAACAPw==",
53+
"byteLength" : 100
54+
}
55+
],
56+
"bufferViews" : [
57+
{
58+
"buffer" : 0,
59+
"byteOffset" : 0,
60+
"byteLength" : 6,
61+
"target" : 34963
62+
},
63+
{
64+
"buffer" : 0,
65+
"byteOffset" : 8,
66+
"byteLength" : 36,
67+
"target" : 34962
68+
},
69+
{
70+
"buffer" : 1,
71+
"byteOffset" : 0,
72+
"byteLength" : 100
73+
}
74+
],
75+
"accessors" : [
76+
{
77+
"bufferView" : 0,
78+
"byteOffset" : 0,
79+
"componentType" : 5123,
80+
"count" : 3,
81+
"type" : "SCALAR",
82+
"max" : [ 2 ],
83+
"min" : [ 0 ]
84+
},
85+
{
86+
"bufferView" : 1,
87+
"byteOffset" : 0,
88+
"componentType" : 5126,
89+
"count" : 3,
90+
"type" : "VEC3",
91+
"max" : [ 1.0, 1.0, 0.0 ],
92+
"min" : [ 0.0, 0.0, 0.0 ]
93+
},
94+
{
95+
"bufferView" : 2,
96+
"byteOffset" : 0,
97+
"componentType" : 5126,
98+
"count" : 5,
99+
"type" : "SCALAR",
100+
"max" : [ 1.0 ],
101+
"min" : [ 0.0 ]
102+
},
103+
{
104+
"bufferView" : 2,
105+
"byteOffset" : 20,
106+
"componentType" : 5126,
107+
"count" : 5,
108+
"type" : "VEC4",
109+
"max" : [ 0.0, 0.0, 1.0, 1.0 ],
110+
"min" : [ 0.0, 0.0, 0.0, -0.707 ]
111+
}
112+
],
113+
114+
"asset" : {
115+
"version" : "2.0"
116+
}
117+
118+
}

0 commit comments

Comments
 (0)