Add 2 mesh and showing one-by-one mesh using Next button click

Hi @all,
In my demo project I’ve two GLB files (bike_1.glb and bike_2.glb). In first time when my app is loaded the bike_1.glb will be loaded by default.
But there is a button in screen with Next button So if I click on Next button the bike_2.glb will shown and bike_1.glb will be replace.
can anyone tells me how to do this…?

In my case loaded bike_1.glb now if i click on No.2 button the bike_2.glb will be loaded.

you can load bike_1 firstly, and then finish loading screen when finished,you can get bike_1’s root from onComplete callback. Next you load bike_2, when finished, you can get bike_2’s root too, bike_2’s root.setEnable(false) to hide it.
When switch, one.setEnable(true) to show and another.setEnable(false) to hide

1 Like

Usually root is meshes[0], its name is image


Yes, this node is created by BJS on the import from blender to convert right-handed system to BJS standards.
I can only advise to unparent from it and remove this as a first step after import since it can create all sorts of issues when further working the scene in BJS. Eventually create a new parent (abstract, mesh or transformNode, if you need it. Else use ‘right-handed’ system for your entire scene.

1 Like

Some additional info to think about for when you want to make your app a little more professional :

• checking if model exists and if needed, to load it ,
• not triggering the load operation everytime or while its perhaps still loading.
• showing relevant progress depending on the asset being handled ( could be more than one )
• blocking certain UI options during loading or permitting loading of other items with previous items then understanding not to display once loaded ( requires tracking an enabled state for each asset , normally using some sort of asset wrapper class )

So you could either disable the navigation during a load , simpler

or you could permit to navigate and start additional loads but app should ideally show relevant loading progress ( or a combined loading progress ) either way, Its not good to have no indication to a end user something is loading. Doesnt have to be a progress bar or number , people also sometimes use placeholders or static loading images/text etc… its up to you.

1 Like

Thanks @Moriy for your reply now understood how to deal with it.