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.

David Duperron

Forum Replies Created

Viewing 15 posts - 61 through 75 (of 83 total)
  • Author
    Posts
  • in reply to: Vue/Quasar Integration #60023
    David Duperron
    Customer

    Hello!
    I’m pulling this old thread up, as I am struggling to update my limited knowledge to the latest developments…
    Ivan,
    I’ve followed the latest instructions to create a Vue App and integrate Verge3D app. Everything works fine and I manage to get your example vue page (with the four V3D apps instances) in my Quasar application. Now I would like to be able to run the same kind of dialogs between the verge3D app integrated into the vue page, with the quasar app itself… and that’s where I find my limits…
    I had this code in the previous versions:

     mounted: function () {
        v3d.PL = v3d.PL || {};
        v3d.PL._vueEventBus = eventBus;
    
        eventBus.$on("Object-clicked", (data) => {
          this.infoModals[data.id] = true;
        });
        eventBus.$on("showNotif", (data) => {
          this.showNotif(data.id);
        });
    
        V3DApp.createApp("scene01.gltf", "scene01_logic.js");
        //V3DApp;
      },

    “Object-clicked” and “showNotif” are procedure defined in the puzzles.
    It seems that in the latest template, this “mounted()” hook is replaced by a “created()” hook, and the “mounted()” hook is only containing this.loadApp().
    Any help would be greatly appreciated!
    Thanks

    David

    in reply to: Verge3d transparency #42042
    David Duperron
    Customer

    Hi!
    Here is a simple setup I made for one of my Projects. The material alpha changes depending on the distance between the camera and the object (far = alpha0; close = alpha1).
    You have to plug a value node to the alpha channel of your material, that you can then control in the Verge3D puzzles. I also put a screenshot of the material settings (alpha blend).
    Hope it will help!
    Cheers

    David

    Attachments:
    You must be logged in to view attached files.
    in reply to: Memory building up #42041
    David Duperron
    Customer

    Thanks GlifTek but I am not loading/unloading assets, but displaying different pages (Vue files) that load different Verge3D gltf files. And each time a new gltf is loaded, the memory usage increases and I cannot find a way to stop this behaviour…

    in reply to: UnloadScene in Vue.js #38450
    David Duperron
    Customer

    I think I found a solution myself…
    I simply removed the listener associated to the scene by adding the following:

      beforeDestroy: function () {
        eventBus.$off();
      },
    

    It seems to work fine!

    in reply to: Vue/Quasar Integration #34714
    David Duperron
    Customer

    Ok, I finally found out where was the problem in the logic.js file. For some reason, the VARS object is only defined once (in the first procedure, acting on the triggerAnim group Objects). see below:

    
    
            registerOnClick(getObjectsFrom(['GROUP', 'triggerAnim'], 'ALL'), function () {
                setHTMLElemStyle('cursor', 'default', ['BODY'], false);
                console.log(['Trigger ', _pGlob.pickedObject, ' has been clicked'].join(''));
                pickedObject = _pGlob.pickedObject;
                var VARS = Object.defineProperties({}, {
                    "animObject": { get: function () { return animObject; }, set: function (val) { animObject = val; } },
                    "animObjectState": { get: function () { return animObjectState; }, set: function (val) { animObjectState = val; } },
                    "hoveredObject": { get: function () { return hoveredObject; }, set: function (val) { hoveredObject = val; } },
                    "pickedObject": { get: function () { return pickedObject; }, set: function (val) { pickedObject = val; } },
                });
    
                Function('app', 'v3d', 'VARS', 'PROC', (('// Built-in variables: app, v3d, VARS, PROC' + '\n' +
                    'v3d.PL._vueEventBus.$emit(\'Object-clicked\', { id: VARS[\'pickedObject\']});')))(appInstance, v3d, VARS, PROC);
    
            }, function () { });
    
            registerOnClick(getObjectsFrom(['GROUP', 'modules'], 'ALL'), function () {
                setHTMLElemStyle('cursor', 'default', ['BODY'], false);
                console.log(['Module ', _pGlob.pickedObject, ' has been clicked'].join(''));
                pickedObject = _pGlob.pickedObject;
    
                Function('app', 'v3d', 'VARS', 'PROC', (('// Built-in variables: app, v3d, VARS, PROC' + '\n' +
                    'v3d.PL._vueEventBus.$emit(\'Object-clicked\', { id: VARS[\'pickedObject\']});')))(appInstance, v3d, VARS, PROC);
    
            }, function () { });
    

    if I simply copy/paste the VARS definition in the second “registerOnClick” (acting on the Modules group objects) it works… the problem is that I will have to do it again each time I regenerate the js fil from my puzzles… is it a bug??

    
    
            registerOnClick(getObjectsFrom(['GROUP', 'triggerAnim'], 'ALL'), function () {
                setHTMLElemStyle('cursor', 'default', ['BODY'], false);
                console.log(['Trigger ', _pGlob.pickedObject, ' has been clicked'].join(''));
                pickedObject = _pGlob.pickedObject;
                var VARS = Object.defineProperties({}, {
                    "animObject": { get: function () { return animObject; }, set: function (val) { animObject = val; } },
                    "animObjectState": { get: function () { return animObjectState; }, set: function (val) { animObjectState = val; } },
                    "hoveredObject": { get: function () { return hoveredObject; }, set: function (val) { hoveredObject = val; } },
                    "pickedObject": { get: function () { return pickedObject; }, set: function (val) { pickedObject = val; } },
                });
    
                Function('app', 'v3d', 'VARS', 'PROC', (('// Built-in variables: app, v3d, VARS, PROC' + '\n' +
                    'v3d.PL._vueEventBus.$emit(\'Object-clicked\', { id: VARS[\'pickedObject\']});')))(appInstance, v3d, VARS, PROC);
    
            }, function () { });
    
            registerOnClick(getObjectsFrom(['GROUP', 'modules'], 'ALL'), function () {
                setHTMLElemStyle('cursor', 'default', ['BODY'], false);
                console.log(['Module ', _pGlob.pickedObject, ' has been clicked'].join(''));
                pickedObject = _pGlob.pickedObject;
                var VARS = Object.defineProperties({}, {
                    "animObject": { get: function () { return animObject; }, set: function (val) { animObject = val; } },
                    "animObjectState": { get: function () { return animObjectState; }, set: function (val) { animObjectState = val; } },
                    "hoveredObject": { get: function () { return hoveredObject; }, set: function (val) { hoveredObject = val; } },
                    "pickedObject": { get: function () { return pickedObject; }, set: function (val) { pickedObject = val; } },
                });
    
                Function('app', 'v3d', 'VARS', 'PROC', (('// Built-in variables: app, v3d, VARS, PROC' + '\n' +
                    'v3d.PL._vueEventBus.$emit(\'Object-clicked\', { id: VARS[\'pickedObject\']});')))(appInstance, v3d, VARS, PROC);
    
            }, function () { });
    
    in reply to: Vue/Quasar Integration #34711
    David Duperron
    Customer

    Hi!
    I continue to work on this subject. As you suggested Ivan I started to call v3d procedures directly from the Quasar/Vue interface and it works like a charm.
    However, I encounter a strange behaviour… I don’t know if it’s a bug or a mistake somewhere, but as soon as I have two active “exec script” blocks in my puzzles, I have an error popping:
    Uncaught ReferenceError: VARS is not defined
    It’s like I can use the VARS[‘myVar’] only once…

    Capture-d-e-cran-2020-10-29-a-14-42-43
    Capture-d-e-cran-2020-10-29-a-14-40-59

    Any idea how to solve this??

    in reply to: Vue/Quasar Integration #34614
    David Duperron
    Customer

    Hi Ivan! Simple as that… :) I will try it ASAP!
    Thank you very much

    And Thanks GlifTek! In fact I discovered this framework on one of your posts here! ;) As you said the fact that you can deploy to any platform with one single code is just perfect… The other things is the great number of built-in components and functions, that look just great out of the box and are so easy to integrate in your app!!
    I’ll keep my Github updated as I progress with this exercise, and try to document it… do not hesitate to clone it and come discuss it here!
    Cheers

    David

    in reply to: Vue/Quasar Integration #34457
    David Duperron
    Customer

    Made a little progress. Now I can trigger events that pass on the clicked object, which is just what I needed.
    Next step, set-up the same kind of communication the other way around: from the Vue page script to the V3D app script, to trigger animations for example. If you have a few minutes to guide me in the right direction?? ;)
    Cheers

    David

    in reply to: Vue/Quasar Integration #34311
    David Duperron
    Customer

    Hope this helps!

    Indeed it helps a lot!! :)
    Now I have a starting point to customize the event and the “listener” to trigger different behaviors depending on which object is clicked.
    I will continue to implement this on the Github project.
    Thanks a lot!

    David

    in reply to: Vue Js & Puzzle editor #33639
    David Duperron
    Customer

    Thanks Ivan!
    I already saw your post, but I must confess that I am far from an expert in Vue.js and actually I have troubles loading the visual_logic.js resource file… I don’t know how to import, or declare or whatever in the .vue or template files to load it properly… I suspect I need to properly import the visual_logic.js resource inside the <script> section of the V3DApp.vue file (similarly to what is done with the app.js file), but I don’t know how…

    EDIT: I managed to get the file loaded by adding the following line to the V3DApp.vue file:
    import * as LOGIC from '../v3dApp/visual_logic.js';
    But now I get a message saying that createApp is not a function… So it’s another issue. I probably need to add something else in the “export” section?

    EDIT2: Ok I just found that there is no createApp function in the app.js file when using the puzzles version… I then called V3DApp; instead of V3DApp.createApp(); once mounted, and got rid of the error… But this is just to go one more step! Now the scene does not load. Must be something to do with path…?

    in reply to: Vue Js & Puzzle editor #33626
    David Duperron
    Customer

    Hi Yuri!
    Thanks for your reply! That’s the guide I followed to get the sample project working inside the Quasar framework. Now as I said I would like to integrate a more complex V3D project, which uses puzzles and therefore its own visual_logic.js file… I will try harder on my own, but if there is a quick help somewhere it’s always welcome! :p
    Cheers

    David

    in reply to: Vue Js & Puzzle editor #33619
    David Duperron
    Customer

    Hi there!
    I was playing with Electron framework, and then discovered Quasar, which seams really powerful!
    I managed to run a simple Quasar application by following the tutorial here without any issue (https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html).
    Now I would like to run a “custom” project instead of the simple V3D cube, i.e. a web app that I would set up using V3D puzzles and js to interact with the rest of the user interface.
    Could any of you guys give me a hand or point me in the right direction?? (like how to set-up the index.vue and/or V3DApp.vue to correctly import the visual_logic.js file…).
    Any help would be greatly appreciated!
    Cheers

    David

    in reply to: Load SVG in scene #29811
    David Duperron
    Customer

    Basically seeing this demo:
    https://cdn.soft8soft.com/demo/examples/index.html?q=svg#webgl_loader_svg
    I thought it was possible to load a SVG file in the 3D scene, and benefit from its SVG crispness to display complicated schematics (electrical, networks, …) and eventually also interact with the SVG itself like what is possible in HTML (active links, change properties, colors…).
    It seems that it is a little more complicated than expected!
    Ans as I’m far from expert in Javascript and coding, it’s a little bit out of my league I’m afraid…

    in reply to: Box Mapping #29428
    David Duperron
    Customer

    Ok but it looks like a “custom” box mapping where you separate X,Y and Z and then project the same wood texture differently along each of the axis with a “flat” mapping… Am I right? :scratch: There is no direct box mapping as far as I could see!?
    Regards

    David

    in reply to: Box Mapping #29272
    David Duperron
    Customer

    Thanks for your answer! But…
    I’ve had a look, but unless I’m wrong the textures use a “flat” projection… I could not find any with the “box” projection (wood, wall, etc…). From version 2.15 it is said that “We supported all available projection modes”. Can you indicate me which material uses this projection mode?
    Thanks very much!

    David

Viewing 15 posts - 61 through 75 (of 83 total)