Configrator creation

I am creating a configrator and want to get models on the button click that are available in the index page and when i click on the button then a canvas will be shown and in that i want that the models gets changed as i click on the buttons
this is the link http://45.79.126.10/AbhiwanDemos/Testbagconfig/ and in that there are three buton and i want to load my models based on the button that i click.

this is what i have crated on babylon https://playground.babylonjs.com/#Z6SWJU#259

It all looks very nice.
Is there a question here, or did you just want to show your progress?

I have a question that i want to change the models on the button click that are shown in the
http://45.79.126.10/AbhiwanDemos/Testbagconfig/ there are three buttons and i want to change the model if i click on bag1 and the other models on bag 2, i am not able to find out how to slove this problem

You have a button which has a click event (or pointer down event). You already know how to subscribe to this event, as you are doing it in the playground.
You are loading a model in the playground as well.
All you need is to combine the two.

You also need to make decisions about your site and the structure you want to have. You can load all 3 models in advance and just enable/disable the meshes when clicking the buttons, or you can import on-demand instead. This is something you need to decide, because you know the site, the data, the structure, the models, everything.

NO there is only one model that is displayed and i want to change the models based on the click.

You must have misunderstood @RaananW 's explanation as this is precisely what he describes. Using enable/disable with change the displayed models whilst keeping them all available.

ok sir thanks for the help and explanation sir , I want the representation of my configrator some thing link this

and want to change the models on the button click this is the html file
config.zip (3.7 KB)
i hope that you could help me and i can learn something new with your help.
Thanks :))

Here is a playground along the lines @RaananW suggests. It loads two models and you can switch between them by clicking the appropriate button. It can be extended to several models.

Hopefully you can adapt it to meet your needs.

2 Likes

Yes i think this will help but i also want to change the texture of the models how will i change the texture of the model

You have the code already to do this. You need to keep track of which model is displayed and just change its material.

2 Likes

i have changed the texture but now i want to change the models that are there when i give the link of my model it gives the error i am not able to under stand that

my model link is in line 52
plz help

You have to load your model using LoadEntity with the correct parameters.

LoadEntity(name, meshNameToLoad, url, file, manager, meshArray, entity_number, props)

name - any name you want to identify your model with
meshNameToLoad - name of mesh when exported, can use “”
url - path to model file
file - name of model file
manager - assets manager to add model to
meshArray - name of array where you will store your model entities, can use if you do not know exported name of model.
entityNumber - index of meshArray to store model.
props - optional can be a vector3 for for positioning or scaling model

Try this and post a PG with your attempt if it does not load.

instead of craetng i just changed the model url in the given LOAd Entity script but thr model does not change and gives error

We need the playground that produces the error.

This is the playground with the error where i get the error if i use mine model url

Your LoadEntity functions do not follow the parameter pattern as given.

The second parameter must be “” or the name you gave to your model when it was exported. The address of your file must be split between the path to the file and the file name.

ok thanks, I will try it out

i tried that but was not able to get the model can you plz help

This playground gets you closer

It needs a lot of refining to get it to look and work as you want but should be enough for you now to work on.

1 Like

Thanks for the help soo much