AsdRA Posted May 8, 2016 Share Posted May 8, 2016 Hi, I'm planning to use Babylon engine to develop a 3D shoe customisation website. The shoe will be customisable part to part. Like, changing the shape of front from curved to pointed, changing heel shape and size, changing texture of each part etc., For this is it right to create a model with submeshes and interact with to change the materials? Is it possible to change the sub mesh in runtime, curved to pointed? or instead of sub mesh will it be feasible to load multiple separate meshes(inner sole, outer sole, heels etc., as separate model meshes) and attach them? Please guide me through the right path. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 9, 2016 Share Posted May 9, 2016 Hi @AsdRA, welcome to the forum. Sorry for slow replies. You have a great project idea, and great questions, too. I have no answers, but my comment will bump this topic up the ladder. We can do some subMesh change tests on http://www.babylonjs-playground.com/#1EIE9G#5 ... see what we can break. Hopefully, experts will comment. Welcome again! cartman 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 9, 2016 Share Posted May 9, 2016 My preference would be to have a shoe data object that stored the minimum details of sizes and shapes for each part then construct a mesh for each part and combine as and when needed to display a shoe. Use an array to keep all the different shoe data objects. But then I am no expert unlike many here and there are probably many better ways. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 9, 2016 Share Posted May 9, 2016 for change dynamic material you can use the shader builder too you just need paint part of your texture with special color and you can replace any material you want in this part and you can change it dynamic . benefit of this way you don't need make high polygon geometry you can manage your part with texture and UV sample : http://melyon.ir/preview/index/30307 http://melyon.ir/preview/index/30309 both use the one material but just change some texture (it is not dynamic but it is easy to make dynamic) Quote Link to comment Share on other sites More sharing options...
dbawel Posted May 10, 2016 Share Posted May 10, 2016 @AsdRA - Perhaps this is not what you had as an ideal example, but by transforming vertices purely, or transforming vertices using morph targets; and writing functions to make these transforms, it might be a somewhat simpler scene. And as for @NasimiAsl - His links can show you how to work with dynamicTextures optimally - which might be an issue for such an application. Cheers, DB Quote Link to comment Share on other sites More sharing options...
AsdRA Posted May 12, 2016 Author Share Posted May 12, 2016 Thanks for all your replies.. Can i have some code sample to load separate meshes and attach them to an invisible parent like a box. I need to know how to position (attach) the individual meshes to create the whole shoe. down voteaccept Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 12, 2016 Share Posted May 12, 2016 if you have a exported file http://www.babylonjs-playground.com/#FT2RY#72 var bottle = new BABYLON.Mesh("", scene); BABYLON.SceneLoader.ImportMesh("", 'https://dl.dropboxusercontent.com/u/17799537/babytest/', 'cubana.babylon', scene,(meshes) => { meshes.forEach((m) => { m.parent = bottle; console.log(m.name); }); }); thanks for @Temechon for this eboo 1 Quote Link to comment Share on other sites More sharing options...
AsdRA Posted May 12, 2016 Author Share Posted May 12, 2016 Thanks and can you please fix this as this shows Compilation error Unexpected token '>' Quote Link to comment Share on other sites More sharing options...
AsdRA Posted May 15, 2016 Author Share Posted May 15, 2016 Sorry, I can't get this playground to work. http://www.babylonjs-playground.com/#FT2RY#72 From the code, i understand how to attach meshes to a parent. Please, let me know will this logic help to position (x,y,z) and attach the separate meshes like heels, upper part, front part, sole etc and make it a complete shoe. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 15, 2016 Share Posted May 15, 2016 it work fine for me : windows 8.1 chrome what is your OS and Browser? Quote Link to comment Share on other sites More sharing options...
AsdRA Posted May 15, 2016 Author Share Posted May 15, 2016 Got it .. thanks.. It was on mac / safari before.. If the bottle model is separated into 3 individual models (for eg. top part, middle and bottom from separate files) and loaded into the scene, how to attach them in correct position to make the complete bottle? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 15, 2016 Share Posted May 15, 2016 a lot of way to make this but i can suggest you shader Builder for keep your mesh is single http://www.babylonjs-playground.com/#FT2RY#75 if it is your main question i can explain sample Quote Link to comment Share on other sites More sharing options...
AsdRA Posted May 15, 2016 Author Share Posted May 15, 2016 @NasimiAsl, thanks for the shader. I think, I'm not expressing my question the right way. Let me explain it in detail. I'm planning to keep the shoe parts changeable and reusable between shoes. For example, Shoe1 will have these parts, a 1. bottom sole, 2. upper body, 3. inner sole, 4. a curved front and 5. a high heels of 4 inches and Shoe2 will have a 1. bottom sole, 2. upper body, 3. inner sole, 4. a pointed front and 5. a heels of 0.5 inches. For this instead of two full shoe models, I'm planning to make the parts as separate models / meshes, each an .obj / .babylon file. So that I can attach them at runtime as per the type of shoe. Shoe1 - bottom.babylon + uBody.babylon + iSole.babylon + cFront.babylon + heels.babylon scaled to 4 inches relatively Shoe2 - bottom.babylon + uBody.babylon + iSole.babylon + pFront.babylon + heels.babylon scaled to 0.5 inches relatively If these meshes are loaded into the scene, how to align and position them to make the complete shoe? Is this method feasible and performance optimized? After loading and stitching the meshes, we can apply shaders or textures to the meshes. Thanks... Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 17, 2016 Share Posted May 17, 2016 Method is feasible but it all depends on how the parts are constructed. For example the upper part of the heel must match the lower part of the sole. Knowing the positions of the upper part heel and lower sole part will tell you how to move them to fit. On the other hand having a range of shoes for your needs and using NasimiAsl's shaderbuilder to give them texture may well be your best bet. 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.