Akatana Posted May 19, 2018 Share Posted May 19, 2018 Hi! I am having a problem with obj Models exported by MagicaVoxel. Somehow the texture is not displaying correctly. I have attached the obj file, the texture and the mtl. I also attached two pictures: one from Babylon and one from MagicaVoxel. What could be the cause of this issue? I hope it can be easily fixed Thank you! sign.mtl sign.obj Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted May 21, 2018 Share Posted May 21, 2018 It looks like to be just a smooth/hard shading issue. I don't know how works MagicaVoxel, but you maybe have an option when exporting the meshes. Or you're also have to try in BJS this mesh property: http://doc.babylonjs.com/api/classes/babylon.mesh#converttoflatshadedmesh Quote Link to comment Share on other sites More sharing options...
Akatana Posted May 21, 2018 Author Share Posted May 21, 2018 Sadly convertToFlatShadedMesh didn't change anything ? MagicaVoxel also doesn't feature any export options, so I guess I will have to convert everything through blender if there is no other way. Maybe some more ideas? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted May 21, 2018 Share Posted May 21, 2018 As a Blender user, I indeed import your .obj into it I guess it's the most simpliest solution to be able to clean the mesh. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 21, 2018 Share Posted May 21, 2018 Hi guys. I hear there are quite a few different .obj formats. I'm certainly no pro... regarding the whole situation. BUT... I think I have an .obj loader playground that broke in v3.2+. Not sure... and it might be predicted and understood... by the core team. https://www.babylonjs-playground.com/#3FV2X#25 You must mouseWheel forward to see the loaded .obj mesh. That... seems like the wrong mouseWheel direction. You can set the camera radius in line 14 (currently 20)... to -180, and get a decent camera position. (weird) But, the mouseWheel is backwards, still. Is the BabylonJS objectLoader plugin... healthy? Did it become z-inverted, somehow? Thoughts? (thx) Quote Link to comment Share on other sites More sharing options...
Guest Posted May 21, 2018 Share Posted May 21, 2018 was it working before? (it is expected to get inverted camera behavior when radius is negative) You can fix it by changing the POV: https://www.babylonjs-playground.com/#3FV2X#26 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 21, 2018 Share Posted May 21, 2018 Ahh, yeah, I didn't see -0.7 alpha. *sigh*. Thx dk. It's a pieced-together PG from an old model that somebody else made. I was backing the camera away from a culled backface and didn't even notice. DUH, Wingy. Sad. I swear I'm getting dumber by the hour. Perhaps Akatana can modify this playground, publish his sign.obj, sign.mtl, and sign.png files... somewhere CORs-clear. Then import them into this playground demo (and do some more saves). We can see what it looks like in the playground, and maybe do some hacking. Akatana, if it's possible for you, zip-up all three files and publish it somewhere where we can DL it. I need to quit putting unnecessary workload onto DK, though. Geez, Wingy. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted May 21, 2018 Share Posted May 21, 2018 BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; Try this line maybe? Quote Link to comment Share on other sites More sharing options...
Akatana Posted May 23, 2018 Author Share Posted May 23, 2018 On 5/21/2018 at 7:39 PM, Pryme8 said: BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; Try this line maybe? That solved it!! thank you so much 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.