Examples/glview - apply translation, rotation, scale in that order

Tested on the Kenney.nl CarKit models: https://www.kenney.nl/assets/car-kit
This commit is contained in:
Dave LeCompte 2022-03-02 07:01:34 -08:00
parent d642c80a86
commit 0ffdc4334a

View File

@ -805,10 +805,6 @@ static void DrawNode(tinygltf::Model &model, const tinygltf::Node &node) {
glMultMatrixd(node.matrix.data());
} else {
// Assume Trans x Rotate x Scale order
if (node.scale.size() == 3) {
glScaled(node.scale[0], node.scale[1], node.scale[2]);
}
if (node.translation.size() == 3) {
glTranslated(node.translation[0], node.translation[1],
node.translation[2]);
@ -823,6 +819,9 @@ static void DrawNode(tinygltf::Model &model, const tinygltf::Node &node) {
glRotated(angleDegrees, axis[0], axis[1], axis[2]);
}
if (node.scale.size() == 3) {
glScaled(node.scale[0], node.scale[1], node.scale[2]);
}
}
// std::cout << "node " << node.name << ", Meshes " << node.meshes.size() <<