[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:58:43 PDT 2020


Could Andreas explain how to use createNode in the context of X_ITE SAI?
I think that createNode may be the one significant thing missing from X3DOM
SAI.
There's an unrelated one in the physics code.

That is, you use createNode to createNodes in SAI, then you use the fields
of the returned object.  Are these the same across browsers?

Here's how to get a node from the standard:

Browser.currentScene.createNode('Shape');

Again, there is no createNode in X3DJSAIL to speak of.

Thanks,

John

On Sat, Apr 11, 2020 at 1:24 AM John Carlson <yottzumm at gmail.com> wrote:

> 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/269ab322/attachment.html>


More information about the x3d-public mailing list