Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Added SimpleSkin example #243

Merged
merged 6 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| [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` |
| [Simple Morph](SimpleMorph) | ![](SimpleMorph/screenshot/screenshot.png) | A triangle with a morph animation applied |
| [Simple Sparse Accessor](SimpleSparseAccessor) | ![](SimpleSparseAccessor/screenshot/screenshot.png) | A simple mesh that uses sparse accessors |
| [Simple Skin](SimpleSkin) | ![](SimpleSkin/screenshot/screenshot.gif) | A simple example of vertex skinning in glTF
| [Cameras](Cameras) | ![](Cameras/screenshot/screenshot.png) | A sample with two different `camera` objects |
| [Interpolation Test](InterpolationTest) | ![](InterpolationTest/screenshot/screenshot.gif) | A sample with three different `animation` interpolations |

Expand Down
24 changes: 24 additions & 0 deletions 2.0/SimpleSkin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SimpleSkin

A simple example for vertex skinning in glTF 2.0.

Details about skinning using this particular model are explained in the
[skinning section of the glTF tutorial](https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_019_SimpleSkin.md).

## Screenshot

![screenshot](screenshot/screenshot.gif)

## License Information

Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/))

## Data layout

The following images show the data layout of this sample:

![skinGeometry](screenshot/skinGeometry.png)
![skinAnimation](screenshot/skinAnimation.png)
![inverseBindMatrices](screenshot/inverseBindMatrices.png)
![skinningData](screenshot/skinningData.png)

131 changes: 131 additions & 0 deletions 2.0/SimpleSkin/glTF-Embedded/SimpleSkin.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"scene" : 0,
"scenes" : [ {
"nodes" : [ 0, 1 ]
} ],

"nodes" : [ {
"skin" : 0,
"mesh" : 0
}, {
"children" : [ 2 ],
"translation" : [ 0.0, 1.0, 0.0 ]
}, {
"rotation" : [ 0.0, 0.0, 0.0, 1.0 ]
} ],

"meshes" : [ {
"primitives" : [ {
"attributes" : {
"POSITION" : 1,
"JOINTS_0" : 2,
"WEIGHTS_0" : 3
},
"indices" : 0
} ]
} ],

"skins" : [ {
"inverseBindMatrices" : 4,
"joints" : [ 1, 2 ]
} ],

"animations" : [ {
"channels" : [ {
"sampler" : 0,
"target" : {
"node" : 2,
"path" : "rotation"
}
} ],
"samplers" : [ {
"input" : 5,
"interpolation" : "LINEAR",
"output" : 6
} ]
} ],

"buffers" : [ {
"uri" : "data:application/gltf-buffer;base64,AAABAAMAAAADAAIAAgADAAUAAgAFAAQABAAFAAcABAAHAAYABgAHAAkABgAJAAgAAAAAvwAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAvwAAAD8AAAAAAAAAPwAAAD8AAAAAAAAAvwAAgD8AAAAAAAAAPwAAgD8AAAAAAAAAvwAAwD8AAAAAAAAAPwAAwD8AAAAAAAAAvwAAAEAAAAAAAAAAPwAAAEAAAAAA",
"byteLength" : 168
}, {
"uri" : "data:application/gltf-buffer;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAABAPwAAgD4AAAAAAAAAAAAAQD8AAIA+AAAAAAAAAAAAAAA/AAAAPwAAAAAAAAAAAAAAPwAAAD8AAAAAAAAAAAAAgD4AAEA/AAAAAAAAAAAAAIA+AABAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAA=",
"byteLength" : 320
}, {
"uri" : "data:application/gltf-buffer;base64,AACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgL8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAgD8=",
"byteLength" : 128
}, {
"uri" : "data:application/gltf-buffer;base64,AAAAAAAAAD8AAIA/AADAPwAAAEAAACBAAABAQAAAYEAAAIBAAACQQAAAoEAAALBAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAPT9ND/0/TQ/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAPT9NL/0/TQ/AAAAAAAAAAD0/TS/9P00PwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAAAAAAAAAIA/",
"byteLength" : 240
} ],

"bufferViews" : [ {
"buffer" : 0,
"byteLength" : 48,
"target" : 34963
}, {
"buffer" : 0,
"byteOffset" : 48,
"byteLength" : 120,
"target" : 34962
}, {
"buffer" : 1,
"byteLength" : 320,
"byteStride" : 16
}, {
"buffer" : 2,
"byteLength" : 128
}, {
"buffer" : 3,
"byteLength" : 240
} ],

"accessors" : [ {
"bufferView" : 0,
"componentType" : 5123,
"count" : 24,
"type" : "SCALAR"
}, {
"bufferView" : 1,
"componentType" : 5126,
"count" : 10,
"type" : "VEC3",
"max" : [ 0.5, 2.0, 0.0 ],
"min" : [ -0.5, 0.0, 0.0 ]
}, {
"bufferView" : 2,
"componentType" : 5123,
"count" : 10,
"type" : "VEC4"
}, {
"bufferView" : 2,
"byteOffset" : 160,
"componentType" : 5126,
"count" : 10,
"type" : "VEC4"
}, {
"bufferView" : 3,
"componentType" : 5126,
"count" : 2,
"type" : "MAT4"
}, {
"bufferView" : 4,
"componentType" : 5126,
"count" : 12,
"type" : "SCALAR",
"max" : [ 5.5 ],
"min" : [ 0.0 ]
}, {
"bufferView" : 4,
"byteOffset" : 48,
"componentType" : 5126,
"count" : 12,
"type" : "VEC4",
"max" : [ 0.0, 0.0, 0.707, 1.0 ],
"min" : [ 0.0, 0.0, -0.707, 0.707 ]
} ],

"asset" : {
"version" : "2.0"
}
}
131 changes: 131 additions & 0 deletions 2.0/SimpleSkin/glTF/SimpleSkin.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"scene" : 0,
"scenes" : [ {
"nodes" : [ 0, 1 ]
} ],

"nodes" : [ {
"skin" : 0,
"mesh" : 0
}, {
"children" : [ 2 ],
"translation" : [ 0.0, 1.0, 0.0 ]
}, {
"rotation" : [ 0.0, 0.0, 0.0, 1.0 ]
} ],

"meshes" : [ {
"primitives" : [ {
"attributes" : {
"POSITION" : 1,
"JOINTS_0" : 2,
"WEIGHTS_0" : 3
},
"indices" : 0
} ]
} ],

"skins" : [ {
"inverseBindMatrices" : 4,
"joints" : [ 1, 2 ]
} ],

"animations" : [ {
"channels" : [ {
"sampler" : 0,
"target" : {
"node" : 2,
"path" : "rotation"
}
} ],
"samplers" : [ {
"input" : 5,
"interpolation" : "LINEAR",
"output" : 6
} ]
} ],

"buffers" : [ {
"uri" : "skinGeometry.bin",
"byteLength" : 168
}, {
"uri" : "skinningData.bin",
"byteLength" : 320
}, {
"uri" : "inverseBindMatrices.bin",
"byteLength" : 128
}, {
"uri" : "skinAnimation.bin",
"byteLength" : 240
} ],

"bufferViews" : [ {
"buffer" : 0,
"byteLength" : 48,
"target" : 34963
}, {
"buffer" : 0,
"byteOffset" : 48,
"byteLength" : 120,
"target" : 34962
}, {
"buffer" : 1,
"byteLength" : 320,
"byteStride" : 16
}, {
"buffer" : 2,
"byteLength" : 128
}, {
"buffer" : 3,
"byteLength" : 240
} ],

"accessors" : [ {
"bufferView" : 0,
"componentType" : 5123,
"count" : 24,
"type" : "SCALAR"
}, {
"bufferView" : 1,
"componentType" : 5126,
"count" : 10,
"type" : "VEC3",
"max" : [ 0.5, 2.0, 0.0 ],
"min" : [ -0.5, 0.0, 0.0 ]
}, {
"bufferView" : 2,
"componentType" : 5123,
"count" : 10,
"type" : "VEC4"
}, {
"bufferView" : 2,
"byteOffset" : 160,
"componentType" : 5126,
"count" : 10,
"type" : "VEC4"
}, {
"bufferView" : 3,
"componentType" : 5126,
"count" : 2,
"type" : "MAT4"
}, {
"bufferView" : 4,
"componentType" : 5126,
"count" : 12,
"type" : "SCALAR",
"max" : [ 5.5 ],
"min" : [ 0.0 ]
}, {
"bufferView" : 4,
"byteOffset" : 48,
"componentType" : 5126,
"count" : 12,
"type" : "VEC4",
"max" : [ 0.0, 0.0, 0.707, 1.0 ],
"min" : [ 0.0, 0.0, -0.707, 0.707 ]
} ],

"asset" : {
"version" : "2.0"
}
}
Binary file added 2.0/SimpleSkin/glTF/inverseBindMatrices.bin
Binary file not shown.
Binary file added 2.0/SimpleSkin/glTF/skinAnimation.bin
Binary file not shown.
Binary file added 2.0/SimpleSkin/glTF/skinGeometry.bin
Binary file not shown.
Binary file added 2.0/SimpleSkin/glTF/skinningData.bin
Binary file not shown.
Binary file added 2.0/SimpleSkin/screenshot/inverseBindMatrices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.0/SimpleSkin/screenshot/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.0/SimpleSkin/screenshot/skinAnimation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.0/SimpleSkin/screenshot/skinGeometry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.0/SimpleSkin/screenshot/skinningData.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.