legallon Posted April 17, 2018 Share Posted April 17, 2018 Hi everyone hope you doing great ! I'm doing a project where I want to create complex objects from more simple or "atomic" ones. For example, I create a vertical rectangle and a horizontal rectangle, I merge them and I have a "L" shape. But when I try to merge my "L" shape with another rectangle to make a "U" for example it doesn't work :/ My question is : is there any way to do what I want to do or am I stuck with only one level of merging ? Thanks a lot for your time Quote Link to comment Share on other sites More sharing options...
JohnK Posted April 17, 2018 Share Posted April 17, 2018 Hi @legallon and welcome to the forum from me. Yes you can merge merged meshes https://www.babylonjs-playground.com/#W2SJLX If you still have problems create a playground. Quote Link to comment Share on other sites More sharing options...
legallon Posted April 17, 2018 Author Share Posted April 17, 2018 Oh, so the error isn't linked with the merge of merged. This is the error message raised : "TypeError: Cannot read property 'copyFrom' of undefined at r.i.computeWorldMatrix (babylon.custom.js:8) at new r.MergeMeshes (babylon.custom.js:15)" Actually I've spent nearly an hour trying to create a playground matching my problem and the result I want to have, but I failed ( the fact is that my code is based on a lot of buttons aiming to create meshes, select them and merge them, and without using GUI I don't think that I can have buttons on the PG ). I can join a .rar of my files (just a 500 lines js and few lines css and html), I don't know if you can do something with that, if you don't that's np I will find it by myself . Thanks again for your time test.rar Quote Link to comment Share on other sites More sharing options...
Guest Posted April 17, 2018 Share Posted April 17, 2018 You can use GUI to create buttons right in the PG: https://www.babylonjs-playground.com/#XCPP9Y#4 legallon 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted April 17, 2018 Share Posted April 17, 2018 Another thing you could do is use a max version of Babylon.js which would give full variable names in the error messages find it in readme file on https://github.com/BabylonJS/Babylon.js Quote Link to comment Share on other sites More sharing options...
legallon Posted April 17, 2018 Author Share Posted April 17, 2018 " TypeError: Cannot read property 'copyFrom' of undefined at Mesh.TransformNode.computeWorldMatrix (babylon.max.js:13723) at new Mesh.MergeMeshes (babylon.max.js:26038)" it happens when I try to do another merge, the first one is always a success but then it fails. It may come from my way of handling selected meshes ( which is possibly bad) 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.