Gonster Posted July 6, 2018 Share Posted July 6, 2018 Hey all, Something wired happens when I am using createInstance API of the Mesh class Please check this https://www.babylonjs-playground.com/#XSCH6V#2 An instance and a clone are created in the callback from the loaded meshes. The clone looks perfect, but the instance renders differently after I have tried backFaceCulling = false and flipFaces. So my question is how can I create an instance that looks the same as the one I get from clone()? Thanks a lot. Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 6, 2018 Share Posted July 6, 2018 The problem in this case is tat the instance doesn't get the mesh's parent (which has a rotation and negative scaling on the z axis). If you want to make the text work on the instance, you will need to negate the z scaling (like here - https://www.babylonjs-playground.com/#XSCH6V#3). Quote Link to comment Share on other sites More sharing options...
Gonster Posted July 6, 2018 Author Share Posted July 6, 2018 @RaananW Thanks a lot for your timely reply. Problem solved. Actually the problem is first appears in my project. I'm using Blender -> glTF-Blender-Exporter(KhronosGroup) -> Babylon.js. It's weird that the root (loaded from the exported glTF file using SceneLoader) has a negative one scaling value. I dont know which part in my tool chain is to blame. I have applied all the scale, rotation and location of the meshes before exporting in Blender. Put aside the problems about animations and materials export, the tool chain is still killing me. Do you have some suggestions about the tools or file format I used? As a newbie, maybe this is the biggest problem. Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 6, 2018 Share Posted July 6, 2018 it is all because of right hand and left hand systems, and the fact that everyone work a bit differently. I dont like this negative scaling as well (there is also a rotation on the y axis ). But this is something you simply need to accept and know. once you know it's there, it is easy to solve those kind of problems. Quote Link to comment Share on other sites More sharing options...
Gonster Posted July 6, 2018 Author Share Posted July 6, 2018 @RaananW Thank you for your explanation. There is no option on z axis flipping in this export tool. So I will set it in my code. Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 6, 2018 Share Posted July 6, 2018 The parent node's z is already flipped for you in the exporter. you will need to deal with the instances yourself, this is where knowing the global object scale (or better yet - entire transformation) is very helpful 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.