[x3d-public] [x3d] Proposal for X3D JSON encoding. Array of arrays foranyarray

Leonard Daly Leonard.Daly at realism.com
Wed Jun 22 19:02:52 PDT 2016


John,

There are a few things I am not grasping. I'm asking these questions to 
make sure I fully understand the implications and impetuous for your 
proposal. I am also concerned because you mention code. Code in the ISO 
structure would be a new thing for the Consortium. It is not something 
we have done before, and the Consortium needs to make sure it 
understands everything before embarking on such a path.

1) "...when translating from the JSON encoding to something else, or 
process the JSON, we assume that the arrays flatten in an in-order manner?"
It sounds like you are serializing the MFNode where you drill down each 
time an element is an MFNode until an SFNode is reached, the go back up 
taking the next, deepest MFNode element to the bottom, repeating until 
all of the SFNode elements have been processed. That would take

[[[A,B]],[C,[D,E]], F]

and turn it into [A,B,C,D,E, F]

where A-F are SFNodes.

Why can't/shouldn't that be done when constructing the JSON. A simple 
example would be great.


2) Is the prototype expander code the driving force behind this request? 
(3) and (4) are probably only necessary if this answer is yes. If it is 
no, what is the driver for expanding the structure of MFNode?

3) What is the prototype expanded code that you are referring to. Is 
this something you have written that parses an X3D file (which 
encoding?) and does something with PROTOs? Is the code 
platform-independent? Is this intended to run stand-alone at a 
particular point in the work flow or can it be integrated into a dynamic 
scene creation, especially if part of the scene comes during a download 
after the initial scene is running?


4) What does the prototype expander code do? How does it interact handle 
code constructed on the fly? How does it handle X3D Script nodes? Does 
it depend/handle "AS" and/or directOutput?

5) If X3D V4 does not have PROTOs, would this be necessary?


Leonard Daly




> Then I would step back and say can we just have it for MFNodes in the 
> JSON encoding, and when translating from the JSON encoding to 
> something else, or process the JSON, we assume that the arrays flatten 
> in an in-order manner? I do that anyway for MFNodes in the JSON 
> Loader, it would just be nice not to have a separate pass or more code 
> to deal with it in the prototype expander.  If the prototype expander 
> is considered throwaway code or proof-of-concept, then I don’t think 
> it really matters.  If we want to make the prototype expander into 
> production quality code, then we need to account for the performance 
> of the code, and likely this means writing more code, which means 
> longer download times for the code, which may mean, over the times 
> it’s downloaded, quite a few bytes.  On the other hand, if we go the 
> other way, we have to consider the processing time for the schema 
> verification and schema download time.  I don’t really have a good 
> feel for this either way.  Perhaps we could go both ways and measure 
> the difference?  We really need some good performance metrics for 
> this, or someone with an eye for performance.  Of the cuff, I would 
> probably say put in a Group node into the output of the prototype 
> expander would be the fastest approach, and only put in a Group node 
> when you are going to have a an array of arrays.  That way, we hope 
> that the processing is done on the client instead of a shared system.
>
> Any other solutions?
>
> Thanks,
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows 10
>
> *From: *Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> *Sent: *Wednesday, June 22, 2016 1:12 PM
> *To: *'John Carlson' <mailto:yottzumm at gmail.com>; 'Leonard Daly' 
> <mailto:Leonard.Daly at realism.com>
> *Cc: *'X3D Graphics member mailing list' <mailto:x3d at web3d.org>
> *Subject: *RE: [x3d] Proposal for X3D JSON encoding. Array of arrays 
> foranyarray
>
> John,
>
> We briefly highlighted this topic during our WG meeting today. The 
> concern is that this proposed change could have significant implications.
>
> For example, the abstract specification 19775-1, in 5.2.2 
> X3DArrayField 
> <http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/fieldsDef.html#X3DAbstractField> 
> states “MFxxxx fields may zero or more values, each of which shall be 
> of the type indicated by the corresponding SFxxxx field type.”. This 
> effectively rules out incorporating arrays within arrays. (NOTE: The 
> quotation above is missing a verb! Another specification comment 
> required!).
>
> If you seriously wish to propose this change then the first formal 
> step is to submit a specification comment 
> <http://www.web3d.org/content/web3d-standards-comment-form>. I would 
> suggest that this could be based on the section of the abstract 
> specification highlighted above. Then, I would follow the Consortium 
> standard procedure of raising a Mantis issue, which would then be 
> discussed by the WG, who would consider all the pros and cons 
> associated with this proposal, and come to a resolution.
>
> I have to revert back to the 19775-1 specification because all the 
> encodings in the 19776 series are written to ensure that content 
> written in any one of the encodings conforms to the requirements of 
> the abstract specification 19775-1. This commonality permits scenes 
> written in one encoding to be easily converted to another encoding. It 
> is not permitted to have, for example, different MFxxxx field content 
> models in the JSON encoding than in the other encodings, or the 
> abstract specification.
>
> Roy
>
> *From:*x3d [mailto:x3d-bounces at web3d.org] *On Behalf Of *John Carlson
> *Sent:* 22 June 2016 08:34
> *To:* Leonard Daly
> *Cc:* X3D Graphics member mailing list
> *Subject:* Re: [x3d] Proposal for X3D JSON encoding. Array of arrays 
> for anyarray
>
> Again, I am only really asking for MFNode arrays to contain MFNodes in 
> the JSON encoding/schema.
>
> On Jun 22, 2016 3:30 AM, "John Carlson" <yottzumm at gmail.com 
> <mailto:yottzumm at gmail.com>> wrote:
>
> Leonard wrote:
>
> > My concern is that if the JSON encoding supports this structure does that mean the structure needs 
> to also appear in the other encodings? If so, how would that be done?
>
> I am not so sure the other encodings don't already support it.  
> Certainly XML does this implicitly. Perhaps some of the binary 
> encodings don't?  idk.
>


-- 
*Leonard Daly*
3D Systems & Cloud Consultant
X3D Co-Chair on Sabbatical
LA ACM SIGGRAPH Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160622/c4e7f30a/attachment.html>


More information about the x3d-public mailing list