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.

my first minified app isn’t acessing the logic files.

Home Forums Programming my first minified app isn’t acessing the logic files.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33421
    GLiFTeK
    Customer

    hi
    i don’t know what went wrong here.. i had it working fine.
    i’ve just been following the instructions for making a barebones app setup, to make things a bit simpler and easier to control,

    was working a while ago, then nope.

    attatched is a zip of the project folder.

    here’s the html / script. (the css is the standard made from puzzle apps.)

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset=utf-8>
        <title>BASIC_V3D_CODE_SETUP</title>
        <style>
          body { margin: 0; }
          canvas { width: 100%; height: 100% }
        </style>
    
    <link rel="stylesheet" type="text/css" href="./styles.css">
    
    </head>
      <body>
        <script src="./v3d.js"></script>
    
        <div id="v3d-container">
          <!-- <div id="fullscreen_button" class="fullscreen-button fullscreen-open" title="Toggle fullscreen mode"></div> -->
        </div>
    
        <script>
    
        // loaded GLTF 2.0 asset
         var sceneURL = './Container_Scene.gltf';
         var logicURL = './visual_logic.js';
        var CONTAINER_ID = 'v3d-container';
        // var ctxSettings = {width:1920, height:1080};
        var ctxSettings = {};
    
        var preloader = new v3d.SimplePreloader({ container: CONTAINER_ID });
    
        var app = new v3d.App(CONTAINER_ID, ctxSettings, preloader);
    
        new v3d.PuzzlesLoader().loadLogic(logicURL, function() {
                  console.log('loading logic...');
    
        app.loadScene(sceneURL, function() {
            console.log('loading scene...');
            app.enableControls();
            app.run();
            runCode();
              });
        });
    
        //    USING ONLOAD
        // var onLoad = function onLoadF(){
    
        //       app.loadScene(sceneURL, function() {
        //           console.log('loading scene...');
        //           app.enableControls();
        //           app.run();
        //           runCode();
        //             });
        //     }
    
        // new v3d.PuzzlesLoader().loadLogic(logicURL, onLoad, function() {
        // console.log('loading logic...');  }); 
    
        function runCode() {
            // place your own code here
    
        //_____________________________________
        // end runcode()
        };
    
      </script>
    
      </body>
    </html>

    any help figuring out why it wont load the logic file would be great thanks

    EDIT: even though I’m using the code from the dev ref page, I think I may have to use the loadScene() callback?

    #33446

    Hi,

    I downloaded you project and it seemingly works fine. It displays a golden cube.

    Chief 3D Verger | LinkedIn | Twitter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.