[x3d-public] node-java X3DJSAIL and 1 example that works, and one that doesn't

John Carlson yottzumm at gmail.com
Fri Apr 10 23:24:51 PDT 2020


We have 2 versions of  JavaScript server side API, Nashorn and Node, both
dependent on X3DJSAIL, and the code looks similar.  However, we do not have
a JavaScript native version yet, even with JSweet (it's incomplete).

I believe that we should pursue an external SAI compatible with X_ITE,
since X3DOM already has an external SAI.

Below is an example of "External" with X_ITE. Note that X3D is required to
be defined, and x_ite.js should be loaded before X3D is called.  So how do
we do that in node?  This is why I've been suggesting headless browsers!

...so...I need to figure out an example of Transform in the standard.  It
would seem like the thing to do would be to implement createNode?  Are
there any examples of createNode?  Yes, in X_ITE at least.  Do we need to
create an execution context to use it?  Yes!

Is there an X_ITE example of external createNode?

Yes!

As far as I can tell there is not a X3DOM version of ECMAScript SAI's
createNode.

So I think we should start with X_ITE as I said before, and try to create
an External ECMAScript SAI script (not DOM).

Do people agree that we should try to create an ECMAScript SAI example from
outside X_ITE?

It appears that we either have to start from X3D(), below.   Can we make
X3D() into an external SAI?

Do we need a browser in nodejs?

has anyone looked into chrome embedded framework?

John



-----------------------------------------------------------------------------
function load_X_ITE_XML(content, selector) {
        X3D(function() {
                var browser = X3D.getBrowser(selector);
                browser.replaceWorld(browser.createX3DFromString(content));
        }, function() {
                alert("Failed to render XML to X_ITE");
        });
}

function load_X_ITE_DOM(element, selector) {
        X3D(function() {
                if (typeof X3D.getBrowser !== 'undefined') {
                        var browser = X3D.getBrowser(selector);
                        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, selector) {
        X3D(function() {
                if (typeof X3D.getBrowser !== 'undefined') {
                        var browser = X3D.getBrowser(selector);
                        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");
        });
}
-------------------------------------------------------------------------------------------------------------
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200411/c71cf5db/attachment-0001.html>


More information about the x3d-public mailing list