timetocode Posted November 28, 2018 Share Posted November 28, 2018 On some objs that I import, I'm having to do foo.scaling = new BABYLON.Vector3(-1, 1, 1). For example this zombie needed the torso scaling set (-1, 1, 1) before the left and right hands appeared on the correct sides of the body among other details. The arms are parented to the torso, so I think that is how the scale is factoring into which side they appear on. The head is actually flipped incorrectly at the moment as well, but that doesn't really matter. I'm fine with scaling(-1,1,1) as a solution, but for some reason the gun now has its mesh inside out or something. So my question is two parts: 1) why is the gun inside out? The parent order (child to parent) is weapon -> leftHand -> lowerLeftArm -> upperLeftArm -> torso. In theory everything is inheriting its scale from torso. Each body part is a separate mesh made the same way, yet only the weapon is inside out, not the torso or any of the arm parts (maybe I just have an error in my code, unless there is some reason that this would naturally by the case). 2) is there a babylon function to fix only an individual mesh? I searched the forum and found many pgs dating back up to 3 years, and some mention of including righthand vs lefthand modes in bjs... but I wasn't sure what the current day method would be to fix just the weapon mesh below. It may be a little hard to see that it is in fact inside-out, so here's another picture of what the weapon is supposed to look like: I cannot use blender+babylon-exporter to make the full model at this point (some complex issues with networking bone animations exported from blender to babylon, a topic for another time). I am still using blender to pose my character as a visual reference before converting the rotations of each body part over to a custom animation system -- so this is perhaps where the conflicting notion of left/right arms is coming from originally. Thanks Quote Link to comment Share on other sites More sharing options...
timetocode Posted November 28, 2018 Author Share Posted November 28, 2018 Found mesh.flipFaces(false) which seems to fix all of the meshes I've had problems with so far. I also tried the full scene-wide flip (scene.useRightHandSystem = true) which worked as well and allowed me to not have any negative scales. I'm going back to left hand though, not sure if it is more intuitive or if I just have too much code that relies on it, but flipping a voxel collision system and maps was not so easy. Sebavan 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.