We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

ubul

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Multiple Verg3D projects with angular #21200
    ubul
    Participant

    thx, I can change the gltf now, but I don’t now it is correct :D

    I declare self.app variable first and i add the app varibale to global after app.loadScene(…).

    
    self.app = app;
    

    When the user clicks another radio button (another building type)

    – I call the self.app.unload();
    – get another sceneURL with the chosen gltf
    – and I call again the app.loadScene but from the global variable:

    
    self.app.loadScene(sceneURL, function () {
                        runCode(self.app, directory);
                        self.app.enableControls();
                        self.app.run();
                        if (v3d.PE)
                            v3d.PE.updateAppInstance(self.app);
                        if (v3d.PL)
                            v3d.PL.init(self.app, initOptions);
                    }, null, function () {
                        console.log('Can\'t load the scene ' + sceneURL);
                    });
    

    The loader is missing now, and better the speed, but can I change the visual logic too? Like .loadSceneWithLogic() in here: https://www.soft8soft.com/docs/api/en/extras/AppPuzzles.html#loadSceneWithLogic

    Because I add the logic file first when i call first the run() function and initialize v3d.

    
    new v3d.PuzzlesLoader().loadLogic(logicURL, function () {
                        var initOptions = v3d.PL ? v3d.PL.execInitPuzzles().initOptions
                                : {useFullscreen: true};
                        loadScene(sceneURL, initOptions, directory);
                    });
    

    but when the user choose another building, I don’t initialize again the v3d to load the logic

Viewing 1 post (of 1 total)