<div dir="ltr"><div dir="auto"><div>Here is a comprehensive test scene which goes through all key intervals of an IntegerSequencer:</div><div><br></div><div><a href="http://x3dom-sequencer-interval-test.glitch.me/IntegerKeyTest.x3d">http://x3dom-sequencer-interval-test.glitch.me/IntegerKeyTest.x3d</a><br></div><div dir="auto"><br></div><div dir="auto">I tested freeWrl, view3dscene, InstantPlayer, x-ite, Octaga, and BS Contact.</div><div dir="auto"><br></div><div dir="auto">Most players show this result:</div><div dir="auto"><br></div><div dir="auto">key < 0: value is 0</div><div dir="auto"><span style="font-family:sans-serif">key = 0: value is 0</span><br></div><div dir="auto"><span style="font-family:sans-serif">key = 0.25: value is 0</span></div><div dir="auto"><span style="font-family:sans-serif">key = 0.5: value is 1</span><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">key = 1: value is 2</span></div><div dir="auto"><span style="font-family:sans-serif">key > 1: value is 2</span><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">for sequence keys=0,0.5,1 and keyValues=0,1,2</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto">This is consistent with left-closed intervals and my slightly revised function definition:</div><div dir="auto"><br></div><div dir="auto"><div>f(t)   =  v_i, if t_{i} <= t < t_{i+1}  for  0 <= i < n-1</div><div class="gmail-m_2022896997683323542quoted-text">        = v_0, if t < t_0,</div><div>        = v_{n-1}, if t >= t_{n-1}</div></div><div dir="auto"><br></div><div>If there is no further comment, I may submit a spec. comment summarizing and referencing this email thread.</div><div dir="auto"><br></div><div dir="auto">view3dscene shows</div><div dir="auto"><span style="font-family:sans-serif">key = 0.5: value is 0</span><br></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">So view3dscene may use right-closed intervals ? Submitted as github issue: </span><font face="sans-serif"><a href="https://github.com/castle-engine/view3dscene/issues/2">https://github.com/castle-engine/view3dscene/issues/2</a></font></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">and InstantPlayer shows</span></div><div dir="auto"><div dir="auto" style="font-family:sans-serif">key < 0: </div><div dir="auto" style="font-family:sans-serif">key = 0: </div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">eg, no values for these two keys. This is the default switch choice so somehow the switches never get routed choices in these cases with InstantPlayer.</div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">Given these results I will adjust the x3dom sequencers to follow the behavior of most browsers, as done here:</div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto"><font face="sans-serif"><a href="http://x3dom-sequencer-interval-test.glitch.me/IntegerKeyTest.html">http://x3dom-sequencer-interval-test.glitch.me/IntegerKeyTest.html</a></font><br></div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">Andreas</div></div><div dir="auto"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Oct 3, 2017 7:21 PM, "Andreas Plesch" <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_2022896997683323542quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div class="gmail-m_2022896997683323542quoted-text">On Tue, Oct 3, 2017 at 12:51 PM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">continued ...</div><div class="gmail_quote">On Tue, Oct 3, 2017 at 9:21 AM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Oct 2, 2017 2:26 PM, "Andreas Plesch" <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail-m_-2482841082302258532gmail-m_3121483784897179930quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Ok, here is a non-interactive test for correct half-closedness of sequencer intervals:<div><br></div><div><a href="http://x3dom-sequencer-interval-test.glitch.me/SequencerInterval_test.x3d" target="_blank">http://x3dom-sequencer-interva<wbr>l-test.glitch.me/SequencerInte<wbr>rval_test.x3d</a><br><div class="gmail_extra"><br></div><div class="gmail_extra">In x3dom:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://x3dom-sequencer-interval-test.glitch.me/" target="_blank">https://x3dom-sequencer-interv<wbr>al-test.glitch.me/</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">With the updated, correct X3DSequencer implementation for x3dom (<a href="https://github.com/andreasplesch/x3dom/blob/IntegerSequencer/src/nodes/EventUtilities/X3DSequencerNode.js" target="_blank">https://github.com/andreasple<wbr>sch/x3dom/blob/IntegerSequence<wbr>r/src/nodes/EventUtilities/X3D<wbr>SequencerNode.js</a>) the cone is illuminated in red.</div><div class="gmail_extra"><br></div><div class="gmail_extra">With the incorrect, earlier implementation for x3dom (<a href="https://glitch.com/edit/#!/x3dom-sequencer-interval-test?path=X3DSequencerNode.js:106:41" target="_blank">https://glitch.com/edit/#!/x3<wbr>dom-sequencer-interval-test?pa<wbr>th=X3DSequencerNode.js:106:41</a>) the cone stays grey.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Testing x-ite it appears that x-ite interpreted intervals to be open on the left and closed on the right (not the intended interpretation): the cone stayed grey.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Getting to other browser hopefully later when I have access to Windows.</div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I tested Octaga, BS Contact, view3dscene and InstantPlayer. All fail the test, eg. the cone stays grey.</div><div dir="auto"><br></div><div dir="auto">Investigating, I changed the test by modifying the keyValues of the BooleanSequencer to turn on the light when the key (0.2) is part of the interval 0 to 0.2, or whatever the second interval is:</div><div dir="auto"><br></div><div dir="auto"><BooleanSequencer DEF='OnOffSequencer' key='0 0.2 0.4 1' keyValue='false true false false' ></BooleanSequencer><br></div><br><a href="http://x3dom-sequencer-interval-test.glitch.me/SequencerInterval_test_rightclosed.x3d" target="_blank">http://x3dom-sequencer-interva<wbr>l-test.glitch.me/SequencerInte<wbr>rval_test_rightclosed.x3d</a></div><div dir="auto"><br><div dir="auto">This is the only change.</div><div dir="auto"><br></div><div dir="auto">For this test, Octaga, BS Contact and x-ite show a red cone. InstantPlayer and view3dscene still show a grey cone, indicating perhaps other issues with the scene (perhaps the routing order).</div><div dir="auto"><br></div><div dir="auto">One explanation is that the players consider the intervals to be closed on the right, upper limit.</div><div dir="auto"><br></div><div dir="auto">Another explanation may be that the players consider t<0 to be part of the first interval - 0 to 0.2 - . Then they would consider - 0.2 to 0.4 - the second interval, thereby turning on the light. This is less likely because the first interval is clearly specified as (−infinity, t0). This can be tested as well by routing 0.1 to the sequencer. This should select the second keyValue turning on the light.</div><div dir="auto"><br></div><div dir="auto">I will try this.</div><div dir="auto"><br></div></div></div></blockquote><div><br></div><div><a href="http://x3dom-sequencer-interval-test.glitch.me/SequencerInterval_test_inFirst.x3d" target="_blank">http://x3dom-sequencer-interva<wbr>l-test.glitch.me/SequencerInte<wbr>rval_test_inFirst.x3d</a> </div><div><br></div><div>is a test if the first (v0) or second keyValue (v1) is selected if the key falls into the interval [t0, t1)<br></div><div><br></div><div>Octaga, InstantPlayer and x-ite all select v0 , unfortunately. I will also test BSContact but expect it to also select v0.</div></div></div></div></blockquote><div><br></div></div><div>BSContact as well as view3dscene do select v0 (true) if the key (0.1) falls into the interval [t0,t1) ( [0, 0.2) ).</div><div>So all tested players behave the same.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail-m_2022896997683323542quoted-text"><div><br></div><div>I believe this is inconsistent with Vince's proposal for a corrected function as the proposal reserves v0 for the interval t<t0 .</div><div><br></div><div>This behaviour is not inconsistent with the current spec. because the current spec. provides a function definition which must be incorrect and is therefore open to interpretation.</div><div><br></div><div>For the sake of practical backward compatibility, therefore Vince's function definition may be altered to:</div><div><br></div></div><div><div>f(t)   =  v_i, if t_{i} <= t < t_{i+1}  for  0 <= i < n-1</div><div class="gmail-m_2022896997683323542quoted-text"><div>        = v_0, if t < t_0,</div></div><div>        = v_{n-1}, if t >= t_{n-1}</div></div><div class="gmail-m_2022896997683323542elided-text"><div><br></div><div>It would be still possible to define a reserved value for the interval t<t0 by repeating the first key: key="0 0 1"</div><div><br></div><div>How does that look ?</div><div><br></div><div>-Andreas</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"><div dir="auto"></div><div dir="auto">-Andreas</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail-m_-2482841082302258532gmail-m_3121483784897179930quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font color="#888888"><div class="gmail_extra"></div></font></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail-m_-2482841082302258532gmail-m_3121483784897179930quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font color="#888888"><div class="gmail_extra"><br></div></font><div class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail-m_-2482841082302258532gmail-m_3121483784897179930elided-text" dir="auto"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 1, 2017 at 11:33 PM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Vince,<div><br></div><div>wolfram is good enough for me. Let me check at least my sequencer x3dom code, and perhaps come up with a simple test.</div><div><br></div><div>-Andreas</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 1, 2017 at 9:42 PM, <a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a> <span dir="ltr"><<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For more on the [a,b) denoting an interval a <= x < b, see <a href="http://mathworld.wolfram.com/Half-ClosedInterval.html" rel="noreferrer" target="_blank">http://mathworld.wolfram.com/H<wbr>alf-ClosedInterval.html</a><br>
<br>
However, I agree that for the practcal problem of clarifying the spec language, we should know how existing browsers have interpreted the currrent language.<br>
<br>
Vince Marchetti<br>
<br>
> On Sep 30, 2017, at 11:47 PM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Sep 30, 2017 7:49 PM, "<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>" <<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>> wrote:<br>
><br>
> > On Sep 4, 2017, at 11:45 AM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br>
> ><br>
> > Resending this without html formatting to ensure proper transmission:<br>
> ><br>
> > 30.2.4 defines how sequencer values are assigned to key intervals:<br>
> ><br>
> > <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/utils.html#SequencingEvents" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/utils.html#Se<wbr>quencingEvents</a><br>
> ><br>
> > (−infinity, t0), [t0, t1), [t1, t2), ... , [tn-1, +infinity)<br>
> ><br>
> > are the intervals.<br>
> ><br>
> > The square bracket [ seems to indicate that the limiting value does not belong to the interval. Is that the case ?<br>
><br>
> I'm more used to the square bracket indicating a closed boundary, so that the for the interval denoted [a,b) ; x is in the interval a <= x < b<br>
> so a is an element of the interval but b is not. Take the view that neither +infinity nor -infinity is a number; so (-infinity,a) is just shorthand for the set x < a, while [a,+infinity) is x >= a.<br>
><br>
> VRML97 seems to be when the bracket for the interval was introduced:<br>
><br>
> <a href="http://tecfa.unige.ch/guides/vrml/vrml97/spec/part1/concepts.html#4.6.8" rel="noreferrer" target="_blank">http://tecfa.unige.ch/guides/v<wbr>rml/vrml97/spec/part1/concepts<wbr>.html#4.6.8</a><br>
><br>
> But it is not accompanied by an explanation. For interpolators it may not matter if the limit is included in the interval since the function is continuous.<br>
><br>
> For sequencers, the function produces different values depending on from which side an interval limit is approached.<br>
><br>
> I guess it is time to look up how various browsers behave at sequencer interval limits.<br>
><br>
><br>
><br>
> ><br>
> > For example, in the second interval [t0, t1) t0 does not belong to the interval but t1 does.<br>
> > I have seen other notations where this interval would be described as ]t0, t1] which I would offer as a suggestion for an improvement.<br>
> ><br>
> > The next question is about the piecewise function definition:<br>
> ><br>
> > f(t) = v_n, if t_n <= t < t_(n-1)<br>
> ><br>
> > Given that the keys t_i are given in a monotonically non-decreasing order, t_n is always larger (or equal to) than t_(n-1). Therefore, a t larger than t_n can never be smaller than t_(n-1). But this is the condition described in the function for value v_n. There is no possible t which can fulfill this condition.<br>
> > Presumably this condition was designed as:<br>
> ><br>
> > f(t) = v_n, if t_n >= t > t_(n-1)<br>
> ><br>
> > If this is the case I can submit a spec. comment but I very much would appreciate additional eyes on that since it seems like a rather fundamental oversight. Did I overlook something ?<br>
> ><br>
><br>
> My set of eyes agrees with yours that the formula form in the v 3.3 version of section 30.2.4 is incorrect, I would propose a corrected version:<br>
><br>
> f(t)    =  v_i, if t_{i-1}   ≤ t < t_{i}  for  1 <= i < n-1<br>
>         = v_0, if t < t_0,<br>
>         = v_{n−1}, if t ≥ t_{n−1}<br>
><br>
><br>
> Looks good to me if [ is meant to include the limit in the interval.<br>
><br>
> Andreas<br>
><br>
><br>
><br>
><br>
><br>
> > The Interpolator component spec. may provide additional insight:<br>
> ><br>
> > <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/interp.html#Linearinterpolation" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/interp.html#L<wbr>inearinterpolation</a><br>
> ><br>
> > Here the equivalent piecewise function definition is:<br>
> ><br>
> > f(t) = linterp(t, v_i, v_(i+1)),    if t_i <= t <= t_(i+1),<br>
> ><br>
> > Note that the interval condition here is between t_i and t_(i+1) and not t_(i-1). So this is correct. But why change for Sequencer to t_(n-1) ? Perhaps there is a reason ?<br>
> ><br>
> > Also note that i is used rather than n which is also more correct since n is reserved for the fixed, total number of keys, whereas i is the variable index depending on the whatever time t is considered.<br>
> ><br>
> > -Andreas<br>
> ><br>
> > --<br>
> > Andreas Plesch<br>
> > Waltham, MA 02453<br>
> > ______________________________<wbr>_________________<br>
> > x3d-public mailing list<br>
> > <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> > <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listi<wbr>nfo/x3d-public_web3d.org</a><br>
><br>
><br>
<br><span class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail-m_-2482841082302258532gmail-m_3121483784897179930m_6053388130301552757gmail-HOEnZb"><font color="#888888">
</font></span></blockquote></div><br></div></blockquote></div>
</div></div></div>
</blockquote></div><br></div></div></div><span class="gmail-m_2022896997683323542m_8718172156278622453HOEnZb"><font color="#888888">
</font></span></div><span class="gmail-m_2022896997683323542m_8718172156278622453HOEnZb"><font color="#888888">
</font></span></blockquote></div></div><div class="gmail-m_2022896997683323542elided-text"><span class="gmail-m_2022896997683323542m_8718172156278622453HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_2022896997683323542m_8718172156278622453m_-2976210655888319414gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div>
</font></span></div></div></div>
</blockquote></div><div class="gmail-m_2022896997683323542elided-text"><br><br clear="all"><br>-- <br><div class="gmail-m_2022896997683323542m_8718172156278622453gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div>
</div></div></div>
</blockquote></div><br></div></div></div>
</div>