Jump to content

Need help to achieve this


AsdRA
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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!  

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

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?

 

 

Capture1.PNG

Link to comment
Share on other sites

@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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...