MisterblueGuy Posted March 14, 2017 Share Posted March 14, 2017 I've been having problems loading GLTF files that load correctly using other graphics packages. I have GLTF files that contain multiple nodes and the nodes would end up rotated oddly. Looking at the code, there is one place where, if the rotation is specified with a quaterion (rather than a matrix) the node rotation is computed with an odd RotationFromAxis computation. If I change the code to just fetch the quaterian from array, the GLTF file loads correctly. The lines in question is 2195 in babylong.glTFFileLoader.js: configureNode(lastNode, BABYLON.Vector3.FromArray(translation), BABYLON.Quaternion.RotationAxis(BABYLON.Vector3.FromArray(rotation).normalize(), rotation[3]), BABYLON.Vector3.FromArray(scale)); works if it is changed to: configureNode(lastNode, BABYLON.Vector3.FromArray(translation), BABYLON.Quaternion.FromArray(rotation), BABYLON.Vector3.FromArray(scale)); Does one of the GLTF loader people know why the code is the way it is, and, is this a bug? (Also, since I'm new here, should this be reported in the GitHub issues or is this the right place?) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 14, 2017 Share Posted March 14, 2017 Hello ping @Luaacro This is really weird and I think that you found a bug do you want to do a PR? Quote Link to comment Share on other sites More sharing options...
MisterblueGuy Posted March 14, 2017 Author Share Posted March 14, 2017 I'll do a PR shortly. Thanks. This could be related to the other rotation discussion as it would only happen if the node's rotation was specified as a quaternion. If it was passed as a matrix (as it is in all of the example objects), one would not see the problem. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 15, 2017 Share Posted March 15, 2017 makes sense (and PR merged) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.