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

Andreas Plesch andreasplesch at gmail.com
Sun Nov 19 13:09:03 PST 2017


Hi Doug,

On Sun, Nov 19, 2017 at 11:58 AM, doug sanden
<highaspirations at hotmail.com> wrote:
> Thanks Andreas.
> Implemented your suggestion of hidden index.
> 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.

Yeah, some browser get keyValue[1] for first next, others get
keyValue[0], depending on initialization.

The spec. seems ambiguous. There are good arguments for either choice
although I would prefer and expect to get keyValue[0] with first next.
Did you follow the spec. in some way when you considered initializing
the hidden index field to 0 ?

Cheers,
-Andreas

> -Doug
> ________________________________________
> From: Andreas Plesch <andreasplesch at gmail.com>
> Sent: November 19, 2017 9:23 AM
> To: doug sanden
> Cc: X3D Graphics public mailing list
> Subject: Re: [x3d-public] keyValue at first next for Sequencers [was: ScalarSequencer proto repo]
>
> 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



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list