Hersir Posted August 31, 2017 Share Posted August 31, 2017 Hi, I have question about creating meshes based on one prototype. I have multiple meshes, that have same geometry but should have different material (color), idea was to create prototype mesh in 3d max, add bump map and export it. Than I found that Mesh class have source mesh, so I passed my prototype mesh into mesh constructor: PG So far everything was working I could create new meshes and change material for them. But problems started when I tried to create instances from new meshes as all instances where moved to same position: PG But if I make clones from meshes they work: PG Was it designed to be used like that, or I am overusing system Maybe there is better way to achieve same result? prototype -> different meshes -> instances. @Deltakosh some ideas there? Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted August 31, 2017 Share Posted August 31, 2017 No idea why your PG don't works, but I had the same issue and solved it like this : http://www.babylonjs-playground.com/#Y3RD10#5 I guess it's because of some caching magic with the geometry property Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 31, 2017 Share Posted August 31, 2017 Hello, the source mesh was created as a support for the instances. Why not simply using clones? they already share the same geometry Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted September 1, 2017 Share Posted September 1, 2017 Topic-jacking ! http://www.babylonjs-playground.com/#Y3RD10#6 with clones when creating mesh-1 and mesh-2, it does not work. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2017 Share Posted September 1, 2017 Hello when using instances and clones you have to make sure that root mesh as an independent geometry: https://www.babylonjs-playground.com/#Y3RD10#7 SvenFrankson 1 Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 4, 2017 Author Share Posted September 4, 2017 Thanks for clarification SvenFrankson 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.