<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Roy,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here’s a related file from X3D resources examples:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.5WoodAppearanceExternalPrototypes.json<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The prototype expander can’t figure out what to put inside the -textureTransform for dark oak.  I think it may put an array</p><p class=MsoNormal>in first, take out the array, and then put -children in when it finds the comment.  Source code for Flattener.js (which adds -children), is not yet checked in.  There is no     "MultiTextureTransform" "TextureTransform" "TextureTransform3D" "TextureTransformMatrix3D" or "ProtoInstance" to add to the -textureTransform, from glancing at it, but I could be doing something wrong (it looks fine).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Flattener code looks like:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>+                       if (SFNodes[p]) {</p><p class=MsoNormal>+                               if (typeof possibleArray === 'object' && possibleArray["#comment"]) {</p><p class=MsoNormal>+                                       newobject[p] = { "-children" : [</p><p class=MsoNormal>+                                               possibleArray</p><p class=MsoNormal>+                                               ]</p><p class=MsoNormal>+                                       };</p><p class=MsoNormal>+                               } else {</p><p class=MsoNormal>+                                       newobject[p] = possibleArray;</p><p class=MsoNormal>+                               }</p><p class=MsoNormal>+                       } else {</p><p class=MsoNormal>+                               newobject[p] = possibleArray;</p><p class=MsoNormal>+                       }</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This was originally much simpler, just:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                                newobject[p] = possibleArray;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Puzzled.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Thursday, July 14, 2016 7:37 PM<br><b>To: </b><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: -textureTransform -children fails to validate</p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>Here’s the source file from the X3D Resources examples:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.json</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Apparently, I must be doing something wrong again!</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Thursday, July 14, 2016 7:27 PM<br><b>To: </b><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>-textureTransform -children fails to validate<o:p></o:p></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>Roy,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The following JSON fails to validate, I think, at this point:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                      "-textureTransform": {</p><p class=MsoNormal>                        "-children": [</p><p class=MsoNormal>                          {</p><p class=MsoNormal>                            "#comment": "NULL node as child"</p><p class=MsoNormal>                          }</p><p class=MsoNormal>                        ]</p><p class=MsoNormal>                      },</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Likely more work needs to be done on the JSON schema and SFNode node fields.  I believe this is how you told me to do it this morning, so please advise.  Note that this is version 3.0, but I am validating with 3.3, I hope, it’s hard to tell, I cleared the 3.0 schema out of my browser.  It would probably be best if you validated against 3.3 yourself.  The error report failure is popping up (-children is an unexpected additional property), so…</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>{</p><p class=MsoNormal>  "X3D": {</p><p class=MsoNormal>    "encoding": "UTF-8",</p><p class=MsoNormal>    "@profile": "Immersive",</p><p class=MsoNormal>    "@version": "3.0",</p><p class=MsoNormal>    "@xsd:noNamespaceSchemaLocation": "http://www.web3d.org/specifications/x3d-3.0.xsd",</p><p class=MsoNormal>    "JSON schema": "http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json",</p><p class=MsoNormal>    "head": {</p><p class=MsoNormal>      "meta": [</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "title",</p><p class=MsoNormal>          "@content": "Figure31.4WoodAppearancePrototypesLibrary.x3d"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "creator",</p><p class=MsoNormal>          "@content": "Figure 31.4, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "reference",</p><p class=MsoNormal>          "@content": "http://www.wiley.com/legacy/compbooks/vrml2sbk/ch31/31fig04.htm"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "translator",</p><p class=MsoNormal>          "@content": "Don Brutzman"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "created",</p><p class=MsoNormal>          "@content": "31 October 2000"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "modified",</p><p class=MsoNormal>          "@content": "28 May 2016"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "description",</p><p class=MsoNormal>          "@content": "An external file containing an appearance library with wood appearances."</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "identifier",</p><p class=MsoNormal>          "@content": "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.x3d"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "generator",</p><p class=MsoNormal>          "@content": "X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "license",</p><p class=MsoNormal>          "@content": "../../license.html"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "translated",</p><p class=MsoNormal>          "@content": "02 July 2016"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "generator",</p><p class=MsoNormal>          "@content": "X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html"</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "@name": "warning",</p><p class=MsoNormal>          "@content": "An experimental version of X3D JSON encoding is used for this scene.  Status online at http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"</p><p class=MsoNormal>        }</p><p class=MsoNormal>      ]</p><p class=MsoNormal>    },</p><p class=MsoNormal>    "Scene": {</p><p class=MsoNormal>      "-children": [</p><p class=MsoNormal>        {},</p><p class=MsoNormal>        {},</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "#comment": "It is a good practice to include default message linking to an example scene, in case a user tries to view this Prototype library directly."</p><p class=MsoNormal>        },</p><p class=MsoNormal>        {</p><p class=MsoNormal>          "Anchor": {</p><p class=MsoNormal>            "@description": "Figure31.5WoodAppearanceExternalPrototypes link",</p><p class=MsoNormal>            "@url": [</p><p class=MsoNormal>              "Figure31.5WoodAppearanceExternalPrototypes.x3d",</p><p class=MsoNormal>              "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.5WoodAppearanceExternalPrototypes.x3d",</p><p class=MsoNormal>              "Figure31.5WoodAppearanceExternalPrototypes.wrl",</p><p class=MsoNormal>              "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.5WoodAppearanceExternalPrototypes.wrl"</p><p class=MsoNormal>            ],</p><p class=MsoNormal>            "-children": [</p><p class=MsoNormal>              {</p><p class=MsoNormal>                "Shape": {</p><p class=MsoNormal>                  "-geometry": {</p><p class=MsoNormal>                    "Text": {</p><p class=MsoNormal>                      "@string": [</p><p class=MsoNormal>                        "Figure31.4WoodAppearancePrototypesLibrary",</p><p class=MsoNormal>                        "contains prototype definitions",</p><p class=MsoNormal>                        "",</p><p class=MsoNormal>                        "Click on text to see these Appearances in",</p><p class=MsoNormal>                        "Figure31.5WoodAppearanceExternalPrototypes"</p><p class=MsoNormal>                      ],</p><p class=MsoNormal>                      "-fontStyle": {</p><p class=MsoNormal>                        "FontStyle": {</p><p class=MsoNormal>                          "@justify": [</p><p class=MsoNormal>                            "MIDDLE",</p><p class=MsoNormal>                            "MIDDLE"</p><p class=MsoNormal>                          ],</p><p class=MsoNormal>                          "@size": 0.5</p><p class=MsoNormal>                        }</p><p class=MsoNormal>                      }</p><p class=MsoNormal>                    }</p><p class=MsoNormal>                  },</p><p class=MsoNormal>                  "-appearance": {</p><p class=MsoNormal>                    "Appearance": {</p><p class=MsoNormal>                      "@DEF": "DECLLightOak_INSTANCE_LightOakAppearance",</p><p class=MsoNormal>                      "-children": [</p><p class=MsoNormal>                        {</p><p class=MsoNormal>                          "#comment": "textureTransform field IS exposed through the Prototype field interface with same name"</p><p class=MsoNormal>                        },</p><p class=MsoNormal>                        {</p><p class=MsoNormal>                          "#comment": "Note that each prototype declaration has independent scope, and so DEF/USE is not possible for sharing. DEF remains a good way to identify the image file however."</p><p class=MsoNormal>                        }</p><p class=MsoNormal>                      ],</p><p class=MsoNormal>                      "-textureTransform": {</p><p class=MsoNormal>                        "-children": [</p><p class=MsoNormal>                          {</p><p class=MsoNormal>                            "#comment": "NULL node as child"</p><p class=MsoNormal>                          }</p><p class=MsoNormal>                        ]</p><p class=MsoNormal>                      },</p><p class=MsoNormal>                      "-material": {</p><p class=MsoNormal>                        "Material": {</p><p class=MsoNormal>                          "@diffuseColor": [</p><p class=MsoNormal>                            1,</p><p class=MsoNormal>                            0.65,</p><p class=MsoNormal>                            0.53</p><p class=MsoNormal>                          ]</p><p class=MsoNormal>                        }</p><p class=MsoNormal>                      },</p><p class=MsoNormal>                      "-texture": {</p><p class=MsoNormal>                        "ImageTexture": {</p><p class=MsoNormal>                          "@DEF": "DECLLightOak_INSTANCE_wood_g_scope2",</p><p class=MsoNormal>                          "@url": [</p><p class=MsoNormal>                            "../Chapter17-Textures/wood_g.jpg",</p><p class=MsoNormal>                            "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter17-Textures/wood_g.jpg"</p><p class=MsoNormal>                          ]</p><p class=MsoNormal>                        }</p><p class=MsoNormal>                      }</p><p class=MsoNormal>                    }</p><p class=MsoNormal>                  }</p><p class=MsoNormal>                }</p><p class=MsoNormal>              }</p><p class=MsoNormal>            ]</p><p class=MsoNormal>          }</p><p class=MsoNormal>        }</p><p class=MsoNormal>      ]</p><p class=MsoNormal>    }</p><p class=MsoNormal>  }</p><p class=MsoNormal>}<span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>