[x3d-public] keyValue at first next for Sequencers [was: ScalarSequencer proto repo]

Andreas Plesch andreasplesch at gmail.com
Sun Nov 19 08:23:26 PST 2017


On Sun, Nov 19, 2017 at 10:28 AM, doug sanden
<highaspirations at hotmail.com> wrote:
> Andreas,
> (sorry still haven't been able to sign up for x3d-public - please forward)
>
> {Boolean/Integer}Sequencer.next, .previous doesn't appear to be implemented in freewrl and I found this code comment:
>
> /* WHAT ARE NEXT AND PREVIOUS FIELDS FOR???? NOT MENTIONED IN SPEC (AT LEAST
> REVISION FOUND WHEN IMPLEMENTING */
> -Doug
>
> Doug hypothesis:
> H0:  rounds next=up, prev=down the last key fraction to closest key, to  get an index, then next=increments/prev=decrements the index and sets the key and ouptuts keyvalue of that index in the key[index] and keyValue[index] arrays

In x3dom, we just keep the index around which was used for the last
value_changed output event, and modulus increment/decrement it for
next/previous.

see https://github.com/x3dom/x3dom/blob/master/src/nodes/EventUtilities/X3DSequencerNode.js#L98

To get an index from the key fraction, we just go through all keys to
find the corresponding interval. Perhaps proven interpolator code can
be reused for this.

Hope this helps,

-Andreas

PS: Adding an experimental ScalarSequencer node may be almost trivial
once the IntegerSequencer node works.

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list