<html xmlns:v="urn:schemas-microsoft-com:vml" 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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>John,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>This is an interesting example, because technically it is not legal X3D  !!<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>That said, having saved it as a file, and tried it on the X3D Validator, it passed validation !!<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Your analysis is correct. Reviewing the standard explains why. Look at ISO/IEC 19775-1 clause 13.3.6 IndexedFaceSet (<a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet">http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet</a>).<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>We’ll start with the eighth paragraph, which includes the words:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>“</span>If the <i>normal</i> field is not <code><span style='font-size:10.0pt'>NULL</span></code>, it shall contain a node derived from <i>X3DNormalNode</i> whose normals are applied to the vertices or faces of the IndexedFaceSet in a manner exactly equivalent to that described above for applying colours to vertices/faces (where <i>normalPerVertex</i> corresponds to <i>colorPerVertex</i> and <i>normalIndex</i> corresponds to <i>colorIndex</i>).”<span style='mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Now let’s look at what should happen for colorIndex when colorPerVertex is false. This is specified at list item d.1. two paragraphs earlier. It reads:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>“</span>If the <i>colorIndex</i> field is not empty, one colour is used for each face of the IndexedFaceSet. There shall be at least as many indices in the <i>colorIndex</i> field as there are faces in the IndexedFaceSet. If the greatest index in the <i>colorIndex</i> field is N, there shall be N+1 colours in the <i>X3DColorNode</i>. The <i>colorIndex</i> field shall not contain any negative entries.”<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Notice the last sentence, where it say there shall not be any negative values.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So, applying these principles to the normals, we can see that there should be no negative values.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Perhaps the Schematron could be improved by adding a rule to check for this scenario. And thinking about it, it would probably be possible to do it in JSON, although it would be complicated.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>All the best,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Roy<span style='mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> x3d-public [mailto:x3d-public-bounces@web3d.org] <b>On Behalf Of </b>John Carlson<br><b>Sent:</b> 19 May 2017 10:57<br><b>To:</b> X3D Graphics public mailing list <x3d-public@web3d.org>; x3dom-users@lists.sourceforge.net<br><b>Subject:</b> [x3d-public] Ran across an interesting example.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Below X3D XML NOT viewable  in X3DOM, (Octaga??), Instant Player (console goes into infinite loop),  H3D complains about: (Unnamed Normal.vector.  Field has size 6).  I think it may be because normalIndex has -1’s when normalPerVertex=false???  If I take out the -1’s, it’s viewable in X3DOM, Octaga, InstantPlayer, and H3D.  The content still needs work, of course (It’s supposed to be a cube!).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>X3DOM’s console looks like:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>x3dom-full.js:4743 Uncaught TypeError: Cannot read property 'x' of undefined<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom.registerNodeType.defineClass.nodeChanged.nodeChanged (x3dom-full.js:4743)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>What does quality assurance report?  I don’t get any significant warnings from X3D-Edit or X3DJSAIL, that I can tell!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Not sure about the standard, but leaving out the -1’s makes sense if normalPerVertex = false, I think.  I’ll let others weigh in about the standard.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>John<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><?xml version="1.0" encoding="UTF-8"?><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "<a href="http://www.web3d.org/specifications/x3d-3.3.dtd">http://www.web3d.org/specifications/x3d-3.3.dtd</a>"><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><X3D profile='Interchange' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    <head><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <meta name='title' content='template.json'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <meta name='identifier' content='http://coderextreme.net/X3DJSONLD/template.json'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <meta name='description' content='Template for an Indexed Face Set'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <meta name='creator' content='John Carlson'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <meta name='created' content='4 April 2017'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    </head><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    <Scene><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        <Group><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>            <Shape><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                <IndexedFaceSet DEF='IndexedFaceSet' colorIndex='0 0 0 -1 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1' coordIndex='0 0 1 -1 0 1 1 -1 2 2 3 3 -1 0 3 3 0 -1 0 3 2 1 -1 1 2 2 1 -1 1 2 3 0 -1' creaseAngle='1.57' normalIndex='0 -1 0 -1 1 -1 2 -1 3 -1 4 -1 5 -1' normalPerVertex='false'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    <Color color='0 1 0'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    <Coordinate point='0 0 1 0 1 1 1 1 1 1 0 1'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    <Normal vector='1 0 0 -1 0 0 0 1 0 0 0 -1 0 -1 0 0 0 1'/><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                </IndexedFaceSet><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>            </Shape><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>        </Group><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    </Scene><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US></X3D><o:p></o:p></span></p></div></body></html>