julien.m Posted June 18, 2018 Share Posted June 18, 2018 Hello, I want to merge meshes but have each part in different colors. In the playground i would like to have a red sphere and a green box with meshes merge. I don't really understand why it isn't working can someone help ? https://playground.babylonjs.com/#INZ0Z0 Quote Link to comment Share on other sites More sharing options...
RaananW Posted June 18, 2018 Share Posted June 18, 2018 In order to use multi materials correctly you will also ned to create submeshes. Here is a quick demo on how to use it - https://playground.babylonjs.com/#INZ0Z0#1 Ir order to get it to work correctly you will need to know the indices count of each submesh created. See here for more - http://doc.babylonjs.com/how_to/multi_materials Quote Link to comment Share on other sites More sharing options...
julien.m Posted June 18, 2018 Author Share Posted June 18, 2018 Thanks for your answer but i thought that the merge method did that on its own. Isn't it the purpose of the last argument subdivideWithSubMeshes: boolean ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted June 18, 2018 Share Posted June 18, 2018 Oh, how could I miss that So, the only thing missing is setting the material index correctly - https://playground.babylonjs.com/#INZ0Z0#2 Quote Link to comment Share on other sites More sharing options...
julien.m Posted June 18, 2018 Author Share Posted June 18, 2018 Thank you very much @RaananW that's exactly what i was looking for Quote Link to comment Share on other sites More sharing options...
JohnK Posted June 18, 2018 Share Posted June 18, 2018 3 hours ago, RaananW said: Oh, how could I miss that So, the only thing missing is setting the material index correctly - https://playground.babylonjs.com/#INZ0Z0#2 Added as example to docs RaananW 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 18, 2018 Share Posted June 18, 2018 You rock guys! 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.