<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Even more than normals or colors, the
      node declares an illegal IndexedFaceSet. In 13.3.6 IndexedFaceSet
      of 19775-1
(<a class="moz-txt-link-freetext" 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>)
      the first paragraph, last sentence after the node definition<br>
      <br>
      <blockquote>Each face of the IndexedFaceSet shall have:
        <ol start="1" type="a">
          <li>at least three non-coincident vertices;</li>
          <li>vertices that define a planar polygon;</li>
          <li>vertices that define a non-self-intersecting polygon.</li>
        </ol>
      </blockquote>
      <p><span lang="EN-US">In you example 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' or
          separately listing the vertex coordinate indices:</span></p>
      <p><span lang="EN-US">1: 0 0 1 -1 <br>
          2: 0 1 1 -1 <br>
          3: 2 2 3 3 -1 <br>
          4: 0 3 3 0 -1 <br>
          5: 0 3 2 1 -1 <br>
          6: 1 2 2 1 -1 <br>
          7: 1 2 3 0 -1</span></p>
      <p><span lang="EN-US">The polygon definitions #1, 2, 3, 4, 6 do
          not meet criteria (a). Since all three are requirements, this
          definition is not legal. The spec is silent about what a
          player should do, so crashing is technically legal (but
          undesirable).</span></p>
      <p><span lang="EN-US"><br>
        </span></p>
      <p><span lang="EN-US">Leonard Daly<br>
        </span></p>
      <p><span lang="EN-US"><br>
        </span></p>
      <p><span lang="EN-US"><br>
        </span></p>
    </div>
    <blockquote type="cite"
      cite="mid:004101d2d08a$0cfae840$26f0b8c0$@ntlworld.com">
      <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]-->
      <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"
              moz-do-not-send="true">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
                [<a class="moz-txt-link-freetext" href="mailto:x3d-public-bounces@web3d.org">mailto:x3d-public-bounces@web3d.org</a>] <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
                <a class="moz-txt-link-rfc2396E" href="mailto:x3d-public@web3d.org"><x3d-public@web3d.org></a>;
                <a class="moz-txt-link-abbreviated" href="mailto:x3dom-users@lists.sourceforge.net">x3dom-users@lists.sourceforge.net</a><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"
              moz-do-not-send="true">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='<a class="moz-txt-link-freetext" href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>'
xsd:noNamespaceSchemaLocation='<a class="moz-txt-link-freetext" href="http://www.web3d.org/specifications/x3d-3.3.xsd">http://www.web3d.org/specifications/x3d-3.3.xsd</a>'><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='<a class="moz-txt-link-freetext" href="http://coderextreme.net/X3DJSONLD/template.json'/">http://coderextreme.net/X3DJSONLD/template.json'/</a>><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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! <a class="moz-txt-link-freetext" href="http://sdm.link/slashdot">http://sdm.link/slashdot</a></pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
X3dom-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:X3dom-users@lists.sourceforge.net">X3dom-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/x3dom-users">https://lists.sourceforge.net/lists/listinfo/x3dom-users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <div class="moz-signature">-- <br>
      <font class="tahoma,arial,helvetica san serif" color="#333366">
        <font size="+1"><b>Leonard Daly</b></font><br>
        3D Systems & Cloud Consultant<br>
        LA ACM SIGGRAPH Chair<br>
        President, Daly Realism - <i>Creating the Future</i>
      </font></div>
  </body>
</html>