[x3d-public] X3D JSON X_ITE scene loading. As well as XML or DOM (oneortheother or both) loading.

John Carlson yottzumm at gmail.com
Sun Mar 4 16:22:07 PST 2018


There’s a new version of X3DJSONLD with ajv-i18n en-US issue resolved.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Sunday, March 4, 2018 7:04 PM
To: Andreas Plesch
Cc: x3d-public at web3d.org; holger.seelig at yahoo.de
Subject: RE: X3D JSON X_ITE scene loading. As well as XML or DOM (oneortheother or both) loading.

JSON parsing should work fine, as evidenced by the following in X3DJSONLD:

http://localhost:3000/src/main/html/x_iteexamples.html
http://localhost:3000/src/main/html/x_iteexamples2.html
https://coderextreme.net/Examples.zip (JSON examples, unpack in X3DJSONLD/src/main)

But perhaps there’s some issue with when the parser gets called? Something different between 4.1.5a and 4.1.3?  I did try to exactly copy the code from one to the other, but perhaps I flubbed?   Seems so close.

Main files modified in X_ITE:

src/x_ite/Parser/JSONParser.js
src/x_ite/InputOuput/FileLoader.js
src/x_ite/Browser/X3DBrowser.js
src/src.mdproj
X_ITE.userprefs (generated I think).

John

Sent from Mail for Windows 10

From: Andreas Plesch
Sent: Sunday, March 4, 2018 6:33 PM
To: John Carlson
Cc: x3d-public at web3d.org; holger.seelig at yahoo.de
Subject: Re: X3D JSON X_ITE scene loading. As well as XML or DOM (one ortheother or both) loading.

On Sun, Mar 4, 2018 at 5:05 PM, John Carlson <yottzumm at gmail.com> wrote:
Here are good ways to reproduce:
 
http://localhost:3000/src/main/html/AP_minimal_JSLD.html

https://rawgit.com/andreasplesch/X3DJSONLD/dev/src/main/html/AP_minimal_JSLD.html
simply uses the freshest x_ite ( version 4.1.5a-212 ) as build by Holger and seems to work fine for loading. (The shader apparently does not quite work anymore).
So perhaps it is more an issue with node or other parts of the loading process ?
Similarly, https://rawgit.com/andreasplesch/X3DJSONLD/dev/src/main/html/index.html also uses the freshest x_ite and the xml loader works. But the json loader stalls which may have to do with the recent merging of the json parsing ? (There are cors issues for x3dom as well).

Cheers,

-Andreas
 
 
http://localhost:3000/src/main/html/AP_minimal_JSLD.xhtml
 
Running node app.js in X3DJSONLD.
 
John
 
Sent from Mail for Windows 10
 
From: Andreas Plesch
Sent: Sunday, March 4, 2018 2:18 PM
To: John Carlson
Cc: x3d-public at web3d.org; holger.seelig at yahoo.de
Subject: Re: X3D JSON X_ITE scene loading. As well as XML or DOM (one or theother or both) loading.
 
Hi John,
I am trying to reproduce the stalled loading issue, probably focusing on DOM (not JSON) loading first. Do you have a live example ? Perhaps something here: https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/html ? 
I just checked x_ite_dom which uses browser.importDocument and browser.replaceWorld: https://andreasplesch.github.io/x_ite_dom/index.xhtml . There are no issues I can see with the latest x_ite here.
 
It may be possible to bisect when this stopped working between 4.1.3 and 4.1.4 using intermediate versions by commit:

https://github.com/create3000/x_ite/commits/master/dist/x_ite.js

For example,
https://rawgit.com/create3000/x_ite/893b68d12099273bbdf41d5a4b283455496671cb/dist/x_ite.js
is 
 X_ITE v4.1.3a-189
-Andreas
On Sun, Mar 4, 2018 at 8:52 AM, John Carlson <yottzumm at gmail.com> wrote:
These are my interfaces to X_ITE 4.1 from JavaScript.  At least 2 of these get stuck loading.  As far as I know, these work with 4.1.3.
 
Andreas, any ideas?   This applies to 4.1.5a (master branch).  I haven’t gotten these interfaces working with 4.1.5a or 4.1.4.  4.1.4 will require my modifications (not published, but a zip is available on request.  4.1.3 with my modifications is also available as a zip on request).  I don’t know if the interfaces disappeared or what??? No clues on console, that I can see.
 
X3D JSON should work fine (through URLs) with 4.1.5a, so that’s not the issue that I know of.
 
I think we need to get these resolved before another release of X_ITE.
 
Andreas, you may push to my coderextreme/X3DJSONLD branch.  X_ITE is installed in src/main/node and src/main/css (and other places, probably inconsequential).  This is my 4.1.3 release of X_ITE right now.
 
John
 
src/main/node/loaderJQuery.js:
 
 
function load_X_ITE_XML(content) {
        X3D(function() {
                var browser = X3D.getBrowser("#x_itexml");
                browser.replaceWorld(browser.createX3DFromString(content));
        }, function() {
                alert("Failed to render XML to X_ITE");
        });
}
 
function load_X_ITE_DOM(element, browserSelector) {
        X3D(function() {
                if (typeof X3D.getBrowser !== 'undefined') {
                        var browser = X3D.getBrowser("#x_itedom");
                        if (typeof browser !== 'undefined' && typeof browser.importDocument !== 'undefined') {
                                var importedScene = browser.importDocument(element);
                                browser.replaceWorld(importedScene);
                        }
                }
        }, function() {
                alert("Failed to render DOM to X_ITE");
        });
}
 
function load_X_ITE_JS(jsobj, browserSelector) {
        X3D(function() {
                if (typeof X3D.getBrowser !== 'undefined') {
                        var browser = X3D.getBrowser("#x_itejson");
                        if (typeof browser !== 'undefined' && typeof browser.importJS !== 'undefined') {
                                var importedScene = browser.importJS(jsobj);
                                browser.replaceWorld(importedScene);
                        }
                }
        }, function() {
                alert("Failed to render JSON to X_ITE");
        });
}
 
 



-- 
Andreas Plesch
Waltham, MA 02453
 



-- 
Andreas Plesch
Waltham, MA 02453


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180304/3c11fe81/attachment-0001.html>


More information about the x3d-public mailing list