Merge pull request #350 from tsmaster/master

Examples/glview - apply translation, rotation, scale in that order
This commit is contained in:
Syoyo Fujita 2022-03-03 03:16:29 +09:00 committed by GitHub
commit 5a90ab76ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() <<