<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;
        color:windowtext;}
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;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        color:black;}
.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;}
/* List Definitions */
@list l0
        {mso-list-id:548885913;
        mso-list-template-ids:-1;}
@list l0:level1
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Leonard, the point is to provide the user with useful debugging assistance, instead of leaving them in the dark…</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><o:p> </o:p></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:Leonard.Daly@realism.com">Leonard Daly</a><br><b>Sent: </b>Friday, May 19, 2017 10:08 AM<br><b>To: </b><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:yottzumm@gmail.com">'John Carlson'</a>; <a href="mailto:x3d-public@web3d.org">'X3D Graphics public mailing list'</a>; <a href="mailto:x3dom-users@lists.sourceforge.net">x3dom-users@lists.sourceforge.net</a><br><b>Subject: </b>Re: Ran across an interesting example.</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:black'>Even more than normals or colors, the node declares an illegal IndexedFaceSet. In 13.3.6 IndexedFaceSet of 19775-1 (<a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet"><span style='color:#0563C1'>http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet</span></a>) the first paragraph, last sentence after the node definition<o:p></o:p></span></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='color:black'>Each face of the IndexedFaceSet shall have: <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='color:black'><span style='mso-list:Ignore'>a.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:black'>at least three non-coincident vertices;<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='color:black'><span style='mso-list:Ignore'>b.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:black'>vertices that define a planar polygon;<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='color:black'><span style='mso-list:Ignore'>c.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:black'>vertices that define a non-self-intersecting polygon.<o:p></o:p></span></p></blockquote><p>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:</p><p>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</p><p>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).</p><p><o:p> </o:p></p><p>Leonard Daly</p><p><o:p> </o:p></p><p><o:p> </o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='color:black'>John,<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>This is an interesting example, because technically it is not legal X3D  !!<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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"><span style='color:#0563C1'>http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet</span></a>).<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>We’ll start with the eighth paragraph, which includes the words:<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>“If the <i>normal</i> field is not </span><code><span style='font-size:10.0pt;color:black'>NULL</span></code><span style='color:black'>, 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>).”<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>“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></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>Notice the last sentence, where it say there shall not be any negative values.<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>So, applying these principles to the normals, we can see that there should be no negative values.<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>All the best,<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>Roy<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:black'>From:</span></b><span style='color:black'> x3d-public [<a href="mailto:x3d-public-bounces@web3d.org"><span style='color:#0563C1'>mailto:x3d-public-bounces@web3d.org</span></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"><span style='color:#0563C1'><x3d-public@web3d.org></span></a>; <a href="mailto:x3dom-users@lists.sourceforge.net"><span style='color:#0563C1'>x3dom-users@lists.sourceforge.net</span></a><br><b>Subject:</b> [x3d-public] Ran across an interesting example.<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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 style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>X3DOM’s console looks like:<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>x3dom-full.js:4743 Uncaught TypeError: Cannot read property 'x' of undefined<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom.registerNodeType.defineClass.nodeChanged.nodeChanged (x3dom-full.js:4743)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom.NodeNameSpace.setupTree (x3dom-full.js:2869)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at x3dom-full.js:2869<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    at Function.Array.forEach (x3dom-full.js:2)<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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 style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>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 style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>John<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><?xml version="1.0" encoding="UTF-8"?><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "<a href="http://www.web3d.org/specifications/x3d-3.3.dtd"><span style='color:#0563C1'>http://www.web3d.org/specifications/x3d-3.3.dtd</span></a>"><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><X3D profile='Interchange' version='3.3' xmlns:xsd='<a href="http://www.w3.org/2001/XMLSchema-instance"><span style='color:#0563C1'>http://www.w3.org/2001/XMLSchema-instance</span></a>' xsd:noNamespaceSchemaLocation='<a href="http://www.web3d.org/specifications/x3d-3.3.xsd"><span style='color:#0563C1'>http://www.web3d.org/specifications/x3d-3.3.xsd</span></a>'><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    <head><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <meta name='title' content='template.json'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <meta name='identifier' content='<a href="http://coderextreme.net/X3DJSONLD/template.json'/"><span style='color:#0563C1'>http://coderextreme.net/X3DJSONLD/template.json'/</span></a>><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <meta name='description' content='Template for an Indexed Face Set'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <meta name='creator' content='John Carlson'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <meta name='created' content='4 April 2017'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    </head><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    <Scene><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        <Group><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>            <Shape><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>                <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 style='color:black'>                    <Color color='0 1 0'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>                    <Coordinate point='0 0 1 0 1 1 1 1 1 1 0 1'/><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>                    <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 style='color:black'>                </IndexedFaceSet><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>            </Shape><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>        </Group><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>    </Scene><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'></X3D><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><br><br><br><o:p></o:p></span></p><pre>------------------------------------------------------------------------------</pre><pre>Check out the vibrant tech community on one of the world's most</pre><pre>engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot">http://sdm.link/slashdot</a></pre><p class=MsoNormal><span style='color:black'><br><br><br><o:p></o:p></span></p><pre>_______________________________________________</pre><pre>X3dom-users mailing list</pre><pre><a href="mailto:X3dom-users@lists.sourceforge.net">X3dom-users@lists.sourceforge.net</a></pre><pre><a href="https://lists.sourceforge.net/lists/listinfo/x3dom-users">https://lists.sourceforge.net/lists/listinfo/x3dom-users</a></pre></blockquote><p><o:p> </o:p></p><p class=MsoNormal><span style='color:black'>-- <br></span><b><span style='font-size:13.5pt;color:#333366'>Leonard Daly</span></b><span style='color:#333366'><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><o:p> </o:p></span></p></div></body></html>