<div dir="ltr"><div>Hi Roy,</div><div><br></div><div>sorry, I did not see your response in time.</div><div><br></div><div>I do think the signatures for colorIndex and normalIndex should be corrected to not include "or -1". Currently, they state:</div><div><br></div><div>MFInt32 []       colorIndex        []   [0,∞) or -1<br></div><div>MFInt32 []       normalIndex        []   [0,∞) or -1<br></div><div><br></div><div>Perhaps these were just copied from coordIndex ? Or did VRML allow the -1 ?</div><div><br></div><div>On the other hand the signature for texCoordIndex is correct:</div><div><br></div><div>MFInt32 []       texCoordIndex     []   [-1,∞)<br></div><div><br></div><div>-Andreas</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 6:24 AM, Roy Walmsley <span dir="ltr"><<a href="mailto:roy.walmsley@ntlworld.com" target="_blank">roy.walmsley@ntlworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="#0563C1" vlink="#954F72"><div class="m_7325860103853338983WordSection1"><p class="MsoNormal"><span>John,<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>This is an interesting example, because technically it is not legal X3D  !!<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>That said, having saved it as a file, and tried it on the X3D Validator, it passed validation !!<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>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" target="_blank">http://www.web3d.org/<wbr>documents/specifications/<wbr>19775-1/V3.3/Part01/<wbr>components/geometry3D.html#<wbr>IndexedFaceSet</a>).<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>We’ll start with the eighth paragraph, which includes the words:<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>“</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><u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>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:<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>“</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.”<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Notice the last sentence, where it say there shall not be any negative values.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">So, applying these principles to the normals, we can see that there should be no negative values.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></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.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">All the best,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Roy<span><u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></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:<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@<wbr>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 href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>>; <a href="mailto:x3dom-users@lists.sourceforge.net" target="_blank">x3dom-users@lists.sourceforge.<wbr>net</a><br><b>Subject:</b> [x3d-public] Ran across an interesting example.<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></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!).<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">X3DOM’s console looks like:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">x3dom-full.js:4743 Uncaught TypeError: Cannot read property 'x' of undefined<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom.registerNodeType.<wbr>defineClass.nodeChanged.<wbr>nodeChanged (x3dom-full.js:4743)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom-full.js:2869<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at Function.Array.forEach (x3dom-full.js:2)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom-full.js:2869<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at Function.Array.forEach (x3dom-full.js:2)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at x3dom-full.js:2869<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    at Function.Array.forEach (x3dom-full.js:2)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></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!<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></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.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">John<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><?xml version="1.0" encoding="UTF-8"?><u></u><u></u></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" target="_blank">http://www.web3d.org/<wbr>specifications/x3d-3.3.dtd</a>"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><X3D profile='Interchange' version='3.3' xmlns:xsd='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/<wbr>2001/XMLSchema-instance</a>' xsd:noNamespaceSchemaLocation=<wbr>'<a href="http://www.web3d.org/specifications/x3d-3.3.xsd" target="_blank">http://www.web3d.org/<wbr>specifications/x3d-3.3.xsd</a>'><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    <head><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <meta name='title' content='template.json'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <meta name='identifier' content='<a href="http://coderextreme.net/X3DJSONLD/template.json'/" target="_blank">http://coderextreme.<wbr>net/X3DJSONLD/template.json'/</a>><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <meta name='description' content='Template for an Indexed Face Set'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <meta name='creator' content='John Carlson'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <meta name='created' content='4 April 2017'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    </head><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    <Scene><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        <Group><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">            <Shape><u></u><u></u></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'><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                    <Color color='0 1 0'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                    <Coordinate point='0 0 1 0 1 1 1 1 1 1 0 1'/><u></u><u></u></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'/><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                </IndexedFaceSet><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">            </Shape><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        </Group><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">    </Scene><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"></X3D><u></u><u></u></span></p></div></div><br>------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world's most<br>
engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>______________________________<wbr>_________________<br>
X3dom-users mailing list<br>
<a href="mailto:X3dom-users@lists.sourceforge.net">X3dom-users@lists.sourceforge.<wbr>net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/x3dom-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/x3dom-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>