babbleon Posted August 29, 2018 Share Posted August 29, 2018 Hello, I am trying to export an OBJ from a scene which was loaded from a .babylon. The loading bit works fine and displays as expected. https://playground.babylonjs.com/#FLVK0U#1 However, the exported OBJ is partially flipped along the X-axis, see screenshot: This is very odd, as both the text and the monkey is one mesh... yet only one is flipped. Does anyone have any bright ideas please? Thank you Quote Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2018 Share Posted August 29, 2018 Pinging our exporter mastermind: @kcoley Quote Link to comment Share on other sites More sharing options...
kcoley Posted August 29, 2018 Share Posted August 29, 2018 Hi @babbleon! Looking at the obj file, I am able to confirm that the monkey is facing the opposite direction of the text. I will look into the obj exporter and investigate. In the meantime, if a potential option that you can use, the glTF exporter in Babylon seems to export as expected. Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 29, 2018 Author Share Posted August 29, 2018 Thank you @kcoley for looking into this. glTF won't work for me at the moment, but thank you for the suggestion. Quote Link to comment Share on other sites More sharing options...
kcoley Posted September 4, 2018 Share Posted September 4, 2018 Hi @babbleon sorry for the delay, but just getting to this. It looks like an issue where the z scale is inverted when exporting with the obj serializer. I am working on a fix, but in the meantime, a workaround you can do is to multiply the scaling on z to -1. i.e. meshes[0].scalling.z *= -1; babbleon 1 Quote Link to comment Share on other sites More sharing options...
babbleon Posted September 5, 2018 Author Share Posted September 5, 2018 Many thanks @kcoley & no worries about the delay, I'm grateful you came back with a workaround! I shall give this a try later on and report if I have any problems. Quote Link to comment Share on other sites More sharing options...
kcoley Posted September 5, 2018 Share Posted September 5, 2018 Hi @babbleon. After further investigation, the issue is because the OBJ format has no notion of "handed-ness", so the geometry written to the file assumes the handedness of the BabylonJS scene. Depending on where the generated OBJ file will be loaded, you may need to do a handedness conversion on the positions. Loading the OBJ file back in BabylonJS requires no change. Negating the scale should work if you are going to Blender or Maya, though you may need to do a different conversion if going to a different application with another handedness convention such as Unreal or Unity, etc. GameMonetize 1 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.