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.

Set Parameters

Home Forums Programming Set Parameters

Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #10614
    craftcode
    Participant

    How can I set params.logic, params.load outside the app.js, for example in the index.html ?

    var logicURL = params.logic ? params.logic : ‘/__LOGIC__visual_logic.js’.replace(‘__LOGIC__’, ”);
    var sceneURL = params.load ? params.load : ‘__URL__vergebed.gltf’.replace(‘__URL__’, ”);

    #10617

    Hi,

    You can set the logicURL and the sceneURL variables by using a global variable specified outside the script.
    For example:

    in index.html:
    var glob_sceneURL = “some/path”;

    in your_app.js:
    var sceneURL = window.glob_sceneURL;

    Chief 3D Verger | LinkedIn | Twitter

    #67154
    huib
    Customer

    Hello,

    I’m bumping this topic because I think its a solution to a problem i’m experiencing, but I don’t understand the solution posted above.

    We are building an interface for Verge in Webflow and we would like to use the Verge canvas directly, instead of an iframe.
    The following files are added to the Webflow page and load correctly from our own webserver:
    v3d.js
    projectname.js
    When visiting the page we get an error that tells us the .gltf and visual_logic.js files cannot be found. The v3d.js file expects them to be at the Webflow location.
    They obviously are not there, they are also on our own webserver.

    What do we need to do to make sure the files get located correctly?
    Hope my question is clear enough haha.

    #67155
    kdv
    Participant

    Share the link. Nobody except you knows what exactly you’ve written in your files…

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67156
    huib
    Customer

    Share the link. Nobody except you knows what exactly you’ve written in your files…

    yeah sure thanks :)

    https://renovatie.webflow.io/canvas

    • This reply was modified 5 months ago by huib.
    #67158
    kdv
    Participant

    Open vastgoeddemo.js and modify it a little

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67160
    huib
    Customer

    Thanks for the reply, pushed that change to the file:
    https://clients.dpipreview.nl/vastgoeddemo/vastgoeddemo.js

    But not loading yet https://renovatie.webflow.io/canvas

    #67161
    kdv
    Participant

    because those files are not in the root directory https://renovatie.webflow.io/

    You are free to use a full path if you can’t use a relative one.

    sceneURL: params.load || 'https://clients.dpipreview.nl/vastgoeddemo/vastgoeddemo.gltf',
    logicURL: params.logic || 'https://clients.dpipreview.nl/vastgoeddemo/visual_logic.js',

    But most likely it will be a forbidden cross-origin access…
    https://stackoverflow.com/questions/31276220/cors-header-access-control-allow-origin-missing

    Just put the vastgoeddemo folder to the same directory where canvas.html is located and use a relative path to files. Or put canvas.html into https://clients.dpipreview.nl/vastgoeddemo/ and use this link https://clients.dpipreview.nl/vastgoeddemo/canvas.html and change nothing in vastgoeddemo.js

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67162
    huib
    Customer

    Thanks for the reply. Yep you are correct! Indeed getting cors errors.

    Guess its not really possible to use Webflow in combination with Verge without using an iframe.
    Since Webflow doesn’t offer the option to upload custom files like .gltf files.

    Thanks again for the help tho :)

    #67163
    kdv
    Participant

    Guess its not really possible to use Webflow in combination with Verge without using an iframe.

    Why not? https://clients.dpipreview.nl/vastgoeddemo/vastgoeddemo.html
    Just save (export) canvas.html, put it into the app’s folder and re-upload the app’s files like you did it before.

    Since Webflow doesn’t offer the option to upload custom files like .gltf files.

    And that’s the problem of web-based CSM editors. They are like iOS :unsure:

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67164
    huib
    Customer

    True that’s possible. I meant that it involves a few extra steps so while working on the interface inside of Webflow the Verge bits wont be visible :)
    Because of the cors thing but yeah guess thats the downside of working with Webflow.

    • This reply was modified 5 months ago by huib.
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.