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