[x3d-public] Peripheral questions about X3D - developmentandbooks

John Carlson yottzumm at gmail.com
Wed Feb 20 15:43:44 PST 2019


JSON – Java Script Object Notation – an alternative to XML “closer” to VRML.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, February 19, 2019 1:25 PM
To: Brutzman, Donald (Don) (CIV); vmarchetti at kshell.com; iam here
Cc: X3D Graphics public mailing list
Subject: RE: [x3d-public] Peripheral questions about X3D - developmentandbooks

I handle JSON by converting JS to DOM after the JSON has been parsed (X3DJSONLD.js). I also have nashorn examples here:  https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/nashorn/net/coderextreme/data  and node.js examples here:  https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data  (requires java-npm library).  The JS APIs are written on top of X3DJSAIL (direct API map of functions to constructors):   http://www.web3d.org/specifications/java/X3DJSAIL.html and thus, are server-side. I currently have no plans to write a pure JS API, but you might try using JSweet to convert Java to JS or TS (problems with converting jars to to JS). Maybe start with this: https://github.com/coderextreme/JavaSceneAuthoringInterfaceLibrary

I have found it easier to convert JSON to DOM, because all the infrastructure in X3DOM is set up to use DOM and the infrastructure in X_ITE is to use DOM and VRML.   While it might be preferable to write native JSON events (and I have done things like this, you are welcome to help), the work is unfinished.  Real PROTOs are present in X_ITE, but not X3DOM (there is a “proto expander” for JSON documents). I don’t know the proper status of Scripts in X3DOM.  What’s important there is routing to and from the Script.

If you were to take on a pure JS API, I would recommend using modules in JavaScript, if they are still in the standard.   That way you can limit the amount of code you load.


There is very little reason to use a JS library unless you are writing Scripts in my examples. I recommend getting help here and other places in order to get the minimum of scripting required (for example, Emitters encapsulate random numbers).

If you share your use cases, you may be able to get a better leg up.  It sure helped me.

Good luck,

John

>> I also had some curiosity about what it takes to WRITE a JS library like the X3D "parser", I guess you could call it....?

>John Carlson has created X3DJSONLD open-source library:

>             https://github.com/coderextreme/X3DJSONLD

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190220/9d925545/attachment.html>


More information about the x3d-public mailing list