[x3d-public] Mantis issue 976: Implicit fields in ClassicVRMLencoding

John Carlson yottzumm at gmail.com
Thu Oct 26 07:41:41 PDT 2017


Here’s my DOM to X3D JSON serializer, unfinished. Please help by all means.  I really need this in my app to avoid server side conversion. Needs a little touch up by an expert in recursion or something.  If the JSON format wasn’t so dang cranky, I could get this out like I did the Python, JavaScript and Java serializers. I suspect an expert in VRML could whiz through this. The JSON format will buy you easy conversion back to DOM as well, with X3DJSONLD.

https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/DOM2JSONSerializer.js

I wouldn’t mind more encodings being supported, Python, JavaScript and Java in addition to VRML, XML and JSON.  It’s very doable, if we can write the standard (currently X3DJSAIL).  It’s shouldn’t be too hard to write a miniparser for the subset of the languages.

If you’d like to browse examples of the JavaScript (Nashorn) encoding, they are here: https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/nashorn/net/coderextreme/data

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Thursday, October 26, 2017 10:21 AM
To: Yves Piguet; Don Brutzman; Roy Walmsley; Richard F. Puk
Cc: X3D Graphics public mailing list
Subject: RE: [x3d-public] Mantis issue 976: Implicit fields in ClassicVRMLencoding

Yves,

We’ve got some comments in JSON.   I believe it’s documented.  If not, it should be.  I think you should use an external JavaScript file and reference it by @url in the Script node, if you like multiline JavaScript—It’s probably better for code editors anyway.  I’d have to check what X3DJSONLD does with this.

JSON is really close to VRML, I think.

We’re not asking you to write anything by hand, except script, not even VRML.  Yes, some touch up on the scenegraph perhaps.  You should invest in learning an authoring tool if you want to do serious work.

If your exporting classic encoding, of course your have a vested interest in maintaining it.  But I suggest you start investing in the JSON format.  It should be easily buildable with JS by using native JavaScript data structures.  If it’s hard to build, may I suggest that you offer suggestions for improvement?  I’d like to make it really easy to construct JSON, and I don’t have a DOM -> JSON converter yet, but I’m close.  Want to help?

John

Sent from Mail for Windows 10

From: Yves Piguet
Sent: Thursday, October 26, 2017 9:59 AM
To: Don Brutzman; Roy Walmsley; Richard F. Puk
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] Mantis issue 976: Implicit fields in Classic VRMLencoding

Dear Roy, Don and Dick,

Thanks for your emails. I'm not very surprised. This suggestion was one of several to get a feeling of what could be considered by the Web3d Consortium, and not the most modest one. We've implemented it in our own js/webgl X3D version (Calerga VR, <https://calerga.com/vr/playground.html>; "Export x3dv/i" once you've loaded one of the models) and we use it (and like it) because it reduces significantly the amount of redundant information in x3dv files. We've dropped the exclamation marks in the proposal.

What I really hope is that the classical encoding will continue getting the attention it deserves. For me, it's the major advantage of X3D over more recent 3D apis: a format simple enough to quickly experiment with just a text editor, yet powerful enough to go beyond the basics. Imo, the XML encoding (and JSON which lacks comments and multiline text for scripts) are too cumbersome to be written by hand. I'm skeptical about the HTML encoding because it won't be seamlessly integrated in major browsers like SVG or MathML and will have compatibility issues with other X3D encodings and semantics. And HTML isn't much nicer than XML in a text editor or powerpoint slides.

Anyway, thanks again, and thanks for all your work on the public mailing list and in more private circles.

Yves

> On 23 Oct 2017, at 14:39, Roy Walmsley <roy.walmsley at ntlworld.com> wrote:
> 
> We recently reviewed this proposal in detail, as part of our updating of V3.3 of X3D to V4.0. We agreed that the “approach is likely to be technically feasible in most cases, and provides excellent insight. Nevertheless the benefits of terseness in VRML encodings is far outweighed by difficulties and problems associated with such a fundamental change in the grammar and in parser implementations. The editors do not want to pursue such a change.”


_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171026/321e1bf9/attachment-0001.html>


More information about the x3d-public mailing list