<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Nov 20, 2017 10:24 AM, "doug sanden" <<a href="mailto:highaspirations@hotmail.com">highaspirations@hotmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">> Did you follow the spec. in some way when you considered initializing<br>
the hidden index field to 0 ?<br>
</div>No - I didn't see any hints in the specs.<br>
If I initialize to -1 then next gives me Child 0, or previous gives me Child n-1 in other words, nothing bad happens with -1, we could do it that way.<br>
<div class="quoted-text"></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I was not quite sure if I missed something in the spec.</div><div dir="auto"><br></div><div dir="auto">To me, it does seem less surprising in a scene which uses sequencers to start with the first keyValue for the first next input.</div><div dir="auto"><br></div><div dir="auto">Another question is if it should be possible to give the set_fraction field an initial value in order to control what the first next input produces ? </div><div dir="auto"><br></div><div dir="auto"><IntegerSequencer set_fraction='.5' key='0 0.5 1' keyValue='1 2 3'/></div><div dir="auto"><br></div><div dir="auto">would produce value_changed=3 for first next.</div><div dir="auto"><br></div><div dir="auto">I think it should.</div><div dir="auto"><br></div><div dir="auto">Will give it a try with various browsers.</div><div dir="auto"><br></div><div dir="auto">BTW, should it be possible to write just 'fraction' instead of 'set_fraction'?</div><div dir="auto"><br></div><div dir="auto">Andreas</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br>
______________________________<wbr>__________<br>
From: Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>><br>
</div>Sent: November 19, 2017 2:09 PM<br>
<div class="elided-text">To: doug sanden<br>
Cc: X3D Graphics public mailing list<br>
Subject: Re: [x3d-public] keyValue at first next for Sequencers [was: ScalarSequencer proto repo]<br>
<br>
Hi Doug,<br>
<br>
On Sun, Nov 19, 2017 at 11:58 AM, doug sanden<br>
<<a href="mailto:highaspirations@hotmail.com">highaspirations@hotmail.com</a>> wrote:<br>
> Thanks Andreas.<br>
> Implemented your suggestion of hidden index.<br>
> If I initialize the hidden index field to 0 during parsing > node instancing, then I get CHILD 1 in your test scene, without further tinkering.<br>
<br>
Yeah, some browser get keyValue[1] for first next, others get<br>
keyValue[0], depending on initialization.<br>
<br>
The spec. seems ambiguous. There are good arguments for either choice<br>
although I would prefer and expect to get keyValue[0] with first next.<br>
Did you follow the spec. in some way when you considered initializing<br>
the hidden index field to 0 ?<br>
<br>
Cheers,<br>
-Andreas<br>
<br>
> -Doug<br>
> ______________________________<wbr>__________<br>
> From: Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>><br>
> Sent: November 19, 2017 9:23 AM<br>
> To: doug sanden<br>
> Cc: X3D Graphics public mailing list<br>
> Subject: Re: [x3d-public] keyValue at first next for Sequencers [was: ScalarSequencer proto repo]<br>
><br>
> On Sun, Nov 19, 2017 at 10:28 AM, doug sanden<br>
> <<a href="mailto:highaspirations@hotmail.com">highaspirations@hotmail.com</a>> wrote:<br>
>> Andreas,<br>
>> (sorry still haven't been able to sign up for x3d-public - please forward)<br>
>><br>
>> {Boolean/Integer}Sequencer.<wbr>next, .previous doesn't appear to be implemented in freewrl and I found this code comment:<br>
>><br>
>> /* WHAT ARE NEXT AND PREVIOUS FIELDS FOR???? NOT MENTIONED IN SPEC (AT LEAST<br>
>> REVISION FOUND WHEN IMPLEMENTING */<br>
>> -Doug<br>
>><br>
>> Doug hypothesis:<br>
>> H0:  rounds next=up, prev=down the last key fraction to closest key, to  get an index, then next=increments/prev=<wbr>decrements the index and sets the key and ouptuts keyvalue of that index in the key[index] and keyValue[index] arrays<br>
><br>
> In x3dom, we just keep the index around which was used for the last<br>
> value_changed output event, and modulus increment/decrement it for<br>
> next/previous.<br>
><br>
> see <a href="https://github.com/x3dom/x3dom/blob/master/src/nodes/EventUtilities/X3DSequencerNode.js#L98" rel="noreferrer" target="_blank">https://github.com/x3dom/<wbr>x3dom/blob/master/src/nodes/<wbr>EventUtilities/<wbr>X3DSequencerNode.js#L98</a><br>
><br>
> To get an index from the key fraction, we just go through all keys to<br>
> find the corresponding interval. Perhaps proven interpolator code can<br>
> be reused for this.<br>
><br>
> Hope this helps,<br>
><br>
> -Andreas<br>
><br>
> PS: Adding an experimental ScalarSequencer node may be almost trivial<br>
> once the IntegerSequencer node works.<br>
><br>
> --<br>
> Andreas Plesch<br>
> Waltham, MA 02453<br>
<br>
<br>
<br>
--<br>
Andreas Plesch<br>
Waltham, MA 02453<br>
</div></blockquote></div><br></div></div></div>