ProfessorF Posted July 1, 2015 Share Posted July 1, 2015 On some skinned character meshes, this code works fine: Meshes[0].rotation.Y = SOME RADIAN VALUE; For example, that line works fine with Microsoft's dude.fbx, and usually any other model that I skin and animate by hand. But on other character meshes - like the ones from Autodesk Character Generator -- the rotation is ignored. Any clues? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 1, 2015 Share Posted July 1, 2015 Hi, I guess you're exporting your model from 3DSMax. There is a option in the scene properties (right click in your viewport -> Babylon -> Babylon Properties) called "export rotationQuaternion instead of Euler angles". I don't remember exactly the name but you got it If this option is checked (by default it's checked), you have to use mesh.rotationQuaternion to rotate your object. When this attribute is set, mesh.rotation is ignored.Be careful, you have to use a quaternion to rotate I think something like this would do the trick:mesh.rotationQuaternion = BABYLON.Quaternion.RotationAxis(BABYLON.Axis.Y, SOME_RADIAN_VALUE) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 1, 2015 Share Posted July 1, 2015 or mesh.rotationQuaternion = null; this way you can use mesh.rotation Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted July 1, 2015 Author Share Posted July 1, 2015 Thanks guys. 1) @Temechon, I unchecked that option in 3DS Max, but it still exported a quaternion. Maybe something for DeltaKosh to fix.2) @Dad72, set to null, but then the character was rotated 90 in the X-axis. I was able to kludge it to work by rotating 90-X and then doing the Y-rotation, but still I'd like to find a solution that works for *any* imported character. Anyway, thanks! I'll keep working on this. #AutoDeskCharacterGenerator #3DSMaxKeywords: AutoDesk Character Generator, 3DS Max, Babylon Exporter Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 1, 2015 Share Posted July 1, 2015 I double checked on my side and unchecking the "Export quaternion" worked for me. If you want to remove the quaternionRotation you have to then set the rotation to the equivalent euler angle rotation (in your case just set rotation = new BABYLON.Vector3(Math.PI/2, 0, 0)) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 2, 2015 Share Posted July 2, 2015 @Prof: I found the bug for the quaternion exporter! Thank you for reporting it the new exporter is on the github now thanks to Luaacro Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 2, 2015 Share Posted July 2, 2015 Nice bug find, you guys! And, it's good to see you again, Prof-F! Come visit us, and tell us of your projects... more often, if you can! You're one of the founding fathers around here. Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted April 21, 2016 Author Share Posted April 21, 2016 Haha, I don't know about that. But my grant is winding down so I definitely will spend more time with the Babylon.js community! Love you guys. Wingnut, GameMonetize and Dad72 3 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.