Skybox Posted March 15, 2017 Share Posted March 15, 2017 Can I ask you some questions about Babylon.js? I am in trouble with loading things into Babylon. First, I exported the model to obj. Then I load it to babylon but to find everything of model is reversed. I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading. I will really appreciate it if you can help solve my problem. Thx. Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 15, 2017 Share Posted March 15, 2017 Maybe some faces are flipped... Can you check in your 3D editor please ? Quote Link to comment Share on other sites More sharing options...
Flomotion Posted March 15, 2017 Share Posted March 15, 2017 Are the objects on the shelf grouped? I've found that the anchor points of objects in groups must be rotated (0,0,0). And the group as well. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 15, 2017 Share Posted March 15, 2017 Hey! How do you produce your babylon file? Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 4 hours ago, Deltakosh said: Hey! How do you produce your babylon file? Hi. I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading. Quote Link to comment Share on other sites More sharing options...
MasterK Posted March 16, 2017 Share Posted March 16, 2017 50 minutes ago, Skybox said: Hi. I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading. Then why dont you just use .babylon exporter and throw objLoader. Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 11 hours ago, Flomotion said: Are the objects on the shelf grouped? I've found that the anchor points of objects in groups must be rotated (0,0,0). And the group as well. Hi. The whole scene is reversed. Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 17 hours ago, Temechon said: Maybe some faces are flipped... Can you check in your 3D editor please ? Hi. The whole scene is reversed. Quote Link to comment Share on other sites More sharing options...
gryff Posted March 16, 2017 Share Posted March 16, 2017 @Skybox : I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right. In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way. There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files. As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 1 hour ago, gryff said: @Skybox : I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right. In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way. There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files. As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. cheers, gryff Thx. I will consider your advice Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 1 hour ago, gryff said: @Skybox : I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right. In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way. There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files. As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. cheers, gryff The reason that I do with obj is that I want to compatible with this format.Because some models only have obj format rather than 3Dmax. The problem on the normals is acceptable but flipping is not. What I really want to solve is a matter of flipping. Thx again. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted March 16, 2017 Share Posted March 16, 2017 This looks like a coordinate system issue to me. By default BabylonJs uses a left handed system but modeling software usally uses a right handed sytem. That means your obj is also right handed. You can try to enabled the right handed system in BabylonJs before importing the model like this: scene.useRightHandedSystem = true; HugoMcPhee 1 Quote Link to comment Share on other sites More sharing options...
Skybox Posted March 16, 2017 Author Share Posted March 16, 2017 1 hour ago, Kesshi said: This looks like a coordinate system issue to me. By default BabylonJs uses a left handed system but modeling software usally uses a right handed sytem. That means your obj is also right handed. You can try to enabled the right handed system in BabylonJs before importing the model like this: scene.useRightHandedSystem = true; Thx so much. You have perfectly helped solve my problem. 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.