ozRocker Posted April 29, 2017 Share Posted April 29, 2017 When I import OBJs the Z-axis is the wrong way around. I saw in the documentation that you're meant to make sure -Z axis is forward, but I'm trying to figure out a way where I can flip my Z-axis without having to open the OBJ in Blender and re-exporting it. This is because I want other users to upload OBJs to the virtual world. I don't want to ask them all to download Blender, import OBJ then export again. Is there a way I can alter the mesh or importer to negate the Z-axis? I tried negative scale on the Z axis but it makes the normals point the wrong way and screws things up Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2017 Share Posted April 30, 2017 This could happen when obj are saved in right handed mode. You can ask the scene to switch to right handed but in this case ALL meshes have to be right handed (scene.useRightHandedSystem = true) Else here are the updates to do to your mesh: - Invert Z (or swap Y and Z depending on the original system) on all vertices - Invert normals (same way) - Change culling mode to CW (mat.sideOrientation = BABYLON.Material.ClockWiseSideOrientation) ozRocker 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.