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

Andreas Plesch andreasplesch at gmail.com
Mon Nov 20 16:27:12 PST 2017


On Nov 20, 2017 10:24 AM, "doug sanden" <highaspirations at hotmail.com> wrote:

> Did you follow the spec. in some way when you considered initializing
the hidden index field to 0 ?
No - I didn't see any hints in the specs.
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.


I was not quite sure if I missed something in the spec.

To me, it does seem less surprising in a scene which uses sequencers to
start with the first keyValue for the first next input.

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 ?

<IntegerSequencer set_fraction='.5' key='0 0.5 1' keyValue='1 2 3'/>

would produce value_changed=3 for first next.

I think it should.

Will give it a try with various browsers.

BTW, should it be possible to write just 'fraction' instead of
'set_fraction'?

Andreas




________________________________________
From: Andreas Plesch <andreasplesch at gmail.com>
Sent: November 19, 2017 2:09 PM
To: doug sanden
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] keyValue at first next for Sequencers [was:
ScalarSequencer proto repo]

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171120/9492150d/attachment.html>


More information about the x3d-public mailing list