Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/difu/skinning-test
Silly testbed to learn skinning
https://github.com/difu/skinning-test
Last synced: about 2 months ago
JSON representation
Silly testbed to learn skinning
- Host: GitHub
- URL: https://github.com/difu/skinning-test
- Owner: difu
- License: gpl-3.0
- Created: 2024-06-16T19:09:27.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-16T20:21:52.000Z (6 months ago)
- Last Synced: 2024-06-17T21:10:04.862Z (6 months ago)
- Language: C++
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# skinning-test
Silly testbed to learn skinningThe code is based on the [Skinning Example by Qt](https://doc.qt.io/qt-6/qtquick3d-skinning-example.html).
Take a look at the [Video](https://www.youtube.com/watch?v=yhcQG4zJkOw).
This example has three hierarchical joints:
```qmllang
Node {
id: joint0
Node {
id: joint1
position.y:10
Node {
id: joint2
position.y:10
}
}
}
```Each joint has its own inverse bind matrix. From the joint offsets you can easily derive the inverse bind matrices.
```qmllang
Skin {
id: skin0
joints: [
joint0,
joint1,
joint2,
]
//! [poses]
inverseBindPoses: [
Qt.matrix4x4(1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1),
Qt.matrix4x4(1, 0, 0, 0,
0, 1, 0, -10,
0, 0, 1, 0,
0, 0, 0, 1),
Qt.matrix4x4(1, 0, 0, 0,
0, 1, 0, -20,
0, 0, 1, 0,
0, 0, 0, 1)
]
//! [poses]
}
```The corresponding mesh consists of three cubes. Each cube is attached to 1 joint.
The center of each cube is also the offset of the connected joint.
```c++
addCube(QVector3D(0, 0, 0), QVector3D(10, 10, 10), 0);
addCube(QVector3D(0, 10.1, 0), QVector3D(10, 10, 10), 1);
addCube(QVector3D(0, 20.2, 0), QVector3D(10, 10, 10), 2);
```