Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 999b3ed

Browse files
authored
Merge pull request KhronosGroup#361 from javagl/MultipleScenes
Add MultipleScenes sample
2 parents fb749f1 + c038bf1 commit 999b3ed

File tree

7 files changed

+253
-0
lines changed

7 files changed

+253
-0
lines changed

2.0/MultipleScenes/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# MultipleScenes
2+
3+
A simple glTF asset with two scenes. Each scene consists of one node with
4+
one mesh. For the first scene, the mesh is a triangle. For the second
5+
scene, the mesh is a square. The default scene is set to `1` by the `scene`
6+
property, so viewers should initially show the scene containing the square.
7+
8+
## Screenshot
9+
10+
![screenshot](screenshot/screenshot.png)
11+
12+
## License Information
13+
14+
Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/))
15+
16+
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"scene" : 1,
3+
"scenes" : [
4+
{
5+
"nodes" : [ 0 ]
6+
},
7+
{
8+
"nodes" : [ 1 ]
9+
}
10+
],
11+
12+
"nodes" : [
13+
{
14+
"mesh" : 0
15+
},
16+
{
17+
"mesh" : 1
18+
}
19+
],
20+
21+
"meshes" : [
22+
{
23+
"primitives" : [ {
24+
"attributes" : {
25+
"POSITION" : 1
26+
},
27+
"indices" : 0
28+
} ]
29+
},
30+
{
31+
"primitives" : [ {
32+
"attributes" : {
33+
"POSITION" : 3
34+
},
35+
"indices" : 2
36+
} ]
37+
}
38+
],
39+
40+
"buffers" : [
41+
{
42+
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=",
43+
"byteLength" : 44
44+
},
45+
{
46+
"uri" : "data:application/octet-stream;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAA",
47+
"byteLength" : 60
48+
}
49+
],
50+
"bufferViews" : [
51+
{
52+
"buffer" : 0,
53+
"byteOffset" : 0,
54+
"byteLength" : 6,
55+
"target" : 34963
56+
},
57+
{
58+
"buffer" : 0,
59+
"byteOffset" : 8,
60+
"byteLength" : 36,
61+
"target" : 34962
62+
},
63+
{
64+
"buffer" : 1,
65+
"byteOffset" : 0,
66+
"byteLength" : 12,
67+
"target" : 34963
68+
},
69+
{
70+
"buffer" : 1,
71+
"byteOffset" : 12,
72+
"byteLength" : 48,
73+
"target" : 34962
74+
}
75+
],
76+
"accessors" : [
77+
{
78+
"bufferView" : 0,
79+
"byteOffset" : 0,
80+
"componentType" : 5123,
81+
"count" : 3,
82+
"type" : "SCALAR",
83+
"max" : [ 2 ],
84+
"min" : [ 0 ]
85+
},
86+
{
87+
"bufferView" : 1,
88+
"byteOffset" : 0,
89+
"componentType" : 5126,
90+
"count" : 3,
91+
"type" : "VEC3",
92+
"max" : [ 1.0, 1.0, 0.0 ],
93+
"min" : [ 0.0, 0.0, 0.0 ]
94+
},
95+
{
96+
"bufferView" : 2,
97+
"byteOffset" : 0,
98+
"componentType" : 5123,
99+
"count" : 6,
100+
"type" : "SCALAR",
101+
"max" : [ 3 ],
102+
"min" : [ 0 ]
103+
},
104+
{
105+
"bufferView" : 3,
106+
"byteOffset" : 0,
107+
"componentType" : 5126,
108+
"count" : 4,
109+
"type" : "VEC3",
110+
"max" : [ 1.0, 1.0, 0.0 ],
111+
"min" : [ 0.0, 0.0, 0.0 ]
112+
}
113+
],
114+
115+
"asset" : {
116+
"version" : "2.0"
117+
}
118+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"scene" : 1,
3+
"scenes" : [
4+
{
5+
"nodes" : [ 0 ]
6+
},
7+
{
8+
"nodes" : [ 1 ]
9+
}
10+
],
11+
12+
"nodes" : [
13+
{
14+
"mesh" : 0
15+
},
16+
{
17+
"mesh" : 1
18+
}
19+
],
20+
21+
"meshes" : [
22+
{
23+
"primitives" : [ {
24+
"attributes" : {
25+
"POSITION" : 1
26+
},
27+
"indices" : 0
28+
} ]
29+
},
30+
{
31+
"primitives" : [ {
32+
"attributes" : {
33+
"POSITION" : 3
34+
},
35+
"indices" : 2
36+
} ]
37+
}
38+
],
39+
40+
"buffers" : [
41+
{
42+
"uri" : "simpleTriangle.bin",
43+
"byteLength" : 44
44+
},
45+
{
46+
"uri" : "simpleSquare.bin",
47+
"byteLength" : 60
48+
}
49+
],
50+
"bufferViews" : [
51+
{
52+
"buffer" : 0,
53+
"byteOffset" : 0,
54+
"byteLength" : 6,
55+
"target" : 34963
56+
},
57+
{
58+
"buffer" : 0,
59+
"byteOffset" : 8,
60+
"byteLength" : 36,
61+
"target" : 34962
62+
},
63+
{
64+
"buffer" : 1,
65+
"byteOffset" : 0,
66+
"byteLength" : 12,
67+
"target" : 34963
68+
},
69+
{
70+
"buffer" : 1,
71+
"byteOffset" : 12,
72+
"byteLength" : 48,
73+
"target" : 34962
74+
}
75+
],
76+
"accessors" : [
77+
{
78+
"bufferView" : 0,
79+
"byteOffset" : 0,
80+
"componentType" : 5123,
81+
"count" : 3,
82+
"type" : "SCALAR",
83+
"max" : [ 2 ],
84+
"min" : [ 0 ]
85+
},
86+
{
87+
"bufferView" : 1,
88+
"byteOffset" : 0,
89+
"componentType" : 5126,
90+
"count" : 3,
91+
"type" : "VEC3",
92+
"max" : [ 1.0, 1.0, 0.0 ],
93+
"min" : [ 0.0, 0.0, 0.0 ]
94+
},
95+
{
96+
"bufferView" : 2,
97+
"byteOffset" : 0,
98+
"componentType" : 5123,
99+
"count" : 6,
100+
"type" : "SCALAR",
101+
"max" : [ 3 ],
102+
"min" : [ 0 ]
103+
},
104+
{
105+
"bufferView" : 3,
106+
"byteOffset" : 0,
107+
"componentType" : 5126,
108+
"count" : 4,
109+
"type" : "VEC3",
110+
"max" : [ 1.0, 1.0, 0.0 ],
111+
"min" : [ 0.0, 0.0, 0.0 ]
112+
}
113+
],
114+
115+
"asset" : {
116+
"version" : "2.0"
117+
}
118+
}
60 Bytes
Binary file not shown.
44 Bytes
Binary file not shown.
31.8 KB
Loading

2.0/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Minimal models testing very narrow pieces of the core specification.
9393
| [Animated Morph Cube](AnimatedMorphCube) | ![](AnimatedMorphCube/screenshot/screenshot.gif) | Demonstrates a simple cube with two simple morph targets and an animation that transitions between them both. |
9494
| [Animated Morph Sphere](AnimatedMorphSphere) | ![](AnimatedMorphSphere/screenshot/screenshot.gif) | This sample is similar to the [Animated Morph Cube](AnimatedMorphCube), but the two morph targets move many more vertices and are more extreme than with the cube. |
9595
| [Simple Meshes](SimpleMeshes) | ![](SimpleMeshes/screenshot/screenshot.png) | A simple `scene` with two `nodes`, both containing the same `mesh`, namely a `mesh` with a single `mesh.primitive` with a single indexed triangle with *multiple* attributes (positions, normals and texture coordinates), but without a `material` |
96+
| [Multiple Scenes](MultipleScenes) | ![](MultipleScenes/screenshot/screenshot.png) | A simple glTF asset with two scenes. Each scene consists of one node with one mesh. For the first scene, the mesh is a triangle. For the second scene, the mesh is a square. The default scene is set to `1` by the `scene` property, so viewers should initially show the scene containing the square.
9697
| [Simple Morph](SimpleMorph) | ![](SimpleMorph/screenshot/screenshot.png) | A triangle with a morph animation applied |
9798
| [Simple Sparse Accessor](SimpleSparseAccessor) | ![](SimpleSparseAccessor/screenshot/screenshot.png) | A simple mesh that uses sparse accessors |
9899
| [Simple Skin](SimpleSkin) | ![](SimpleSkin/screenshot/screenshot.gif) | A simple example of vertex skinning in glTF

0 commit comments

Comments
 (0)