<div dir="ltr"><div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Oct 9, 2017 11:02 PM, "Andreas Plesch" <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_-101175558033131410quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Good points but consider:<div dir="auto"><br></div><div dir="auto">Interpolators with step functions act almost like sequencers but do not have the 'next' and 'previous' fields. These fields could be added, however. 'next' would proceed to next keyValue interval, either to the lower limit or to the equivalent interpolated value within that interval. With these fields, I agree, there would be no need for more sequencers.</div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Another, perhaps less invasive approach would be to allow integers as input to interpolator key fields. Then IntegerSequencer could be used to drive any interpolator. Although keys are often in the 0 to 1 range, they can have any value.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_-101175558033131410quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">All event utility nodes (and many others) can be implemented as protos, so there have to be other criteria. A ScalarSequencer is so useful that it should be considered a candidate for a standard node because it provides sequencer access to most other field types for very little implementation and specification cost.</div><div dir="auto"><br></div><div dir="auto">Atypical user interaction may require the flexibility of scripts but once scripts are used for logic in a scene it is likely that it becomes preferable to handle all logic in the scripts, eg. avoid the event utilities.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">-- I noticed the x3dom TouchSensor requiring mouse movement between clicks as well. Should be fixable.</div><div class="gmail-m_-101175558033131410elided-text"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Oct 9, 2017 8:10 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br type="attribution"><blockquote class="gmail-m_-101175558033131410m_5098825802841159752quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/6/2017 12:17 PM, Andreas Plesch wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Here is the<br>
<br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptComplexStateEventsIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForWebAuthors/Chapter09-E<wbr>ventUtilitiesScripting/ScriptC<wbr>omplexStateEventsIndex.html</a><br>
</blockquote>
<br>
Thanks for looking at this example again Andreas.<br>
<br>
I noticed that the 4-state cycle script was keeping track of state value [0,1,2,3] as part of inputOutput field buttonPushCount, and so added some text labels under a Switch node to help illustrate it.  Pretty simple addition.<br></blockquote></div></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I believe without a script this would require the addition of an IntegerSequencer but not much more. In fact, I updated <a href="https://quirky-winter.glitch.me/" rel="noreferrer" target="_blank">https://quirky-winter.glitch.m<wbr>e/</a> accordingly.</div><div dir="auto"><br></div><div dir="auto">This is also an example which demonstrates how a TextSequencer would be handy as it could avoid the long switch node. In the script, it would be equivalent to add a MFString output field and setting it along with buttonPushCount (perhaps from an array).</div><div dir="auto"><br></div><div>-Andreas</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_-101175558033131410quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div class="gmail-m_-101175558033131410elided-text"><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="gmail-m_-101175558033131410m_5098825802841159752quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
        <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/ScriptComplexStateEventsIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForWebAuthors/Chapter09Ev<wbr>entUtilitiesScripting/ScriptCo<wbr>mplexStateEventsIndex.html</a><br>
<br>
        <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/ScriptComplexStateEventsX_ITE.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForWebAuthors/Chapter09Ev<wbr>entUtilitiesScripting/ScriptCo<wbr>mplexStateEventsX_ITE.html</a><br>
<br>
Also have applied background color-coding to the pretty-print html documentation to help highlight what the purpose of each node.  Redeploying pretty-print updates tonight (with thanks to Sung Min Kwon for helpful discussions on this topic).<br>
- (Light blue background: behavior node)<br>
- (Grey background: inserted documentation)<br>
- (Magenta background: X3D Extensibility)<br>
<br>
        <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/ScriptComplexStateEvents.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForWebAuthors/Chapter09Ev<wbr>entUtilitiesScripting/ScriptCo<wbr>mplexStateEvents.html</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
converted using a ScalarSequencer (naming following ScalarInterpolator):<br>
<br>
<a href="https://quirky-winter.glitch.me/" rel="noreferrer" target="_blank">https://quirky-winter.glitch.m<wbr>e/</a><br>
</blockquote>
<br>
Trouble report: the push button requires an irregular number of clicks before the light changes. (Windows 10 Firefox)<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
And here are the relevant changes to the scene<br>
<br>
<a href="https://glitch.com/edit/#!/quirky-winter?path=index.html:75:7" rel="noreferrer" target="_blank">https://glitch.com/edit/#!/qui<wbr>rky-winter?path=index.html:75:<wbr>7</a><br>
<br>
Replacing the script and its custom field declarations, there is now only one Sequencer node, one ColorInterpolator and one additional route, three lines.<br>
<br>
This pattern would be the main intended usage, eg. using sequencer fraction output to get interpolator typed output for use in the scene (colors, orientations, positions ..).<br>
<br>
How does that look ?<br>
<br>
-Andreas<br>
</blockquote>
<br>
Well the result is certainly simpler, which is good.  To be fair about such a comparison though, it is good to realize that this example is intended to illustrate such simple Script design for atypical user interaction.  Whatever works.<br>
<br>
This case also illustrates the potential usefulness of prototypes, certainly ScalarSequencer can be implemented in that fashion.<br>
<br>
For the general case of sequencing Float Vec2f Vec3f Vec4f, we considered adding such node(s) to the X3D specification.  However we decided against that because the same effect is possible when putting adjacent values together in the keyValue array, effectively creating step functions.  We left it up to the X3D player to be able to avoid sending unchanging intermediate values during a step, avoiding excess events.<br>
<br>
Probably further prose about step functions is needed, this relates to recent discussion about the piecewise-linear interpolating function f(t).<br>
<br>
        19.2.2 Linear interpolation<br>
        <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/interp.html#ScalarInterpolator" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/interp.html#S<wbr>calarInterpolator</a><br>
and<br>
        19.3.1 X3DInterpolatorNode<br>
        <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/interp.html#X3DInterpolatorNode" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/interp.html#X<wbr>3DInterpolatorNode</a><br>
<br>
Perhaps we should add something to spec like:<br>
<br>
        NOTE<br>
        Identical adjacent entries in the keyValue array have the effect of defining constant-value step functions.<br>
<br>
Added a tooltip to the floating-point interpolators about step functions. Further information on that term is available on Wikipedia.<br>
<br>
        <a href="http://www.web3d.org/x3d/content/X3dTooltips.html#ScalarInterpolator" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/conte<wbr>nt/X3dTooltips.html#ScalarInte<wbr>rpolator</a><br>
<br>
        <a href="https://en.wikipedia.org/wiki/Step_function" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>Step_function</a><br>
<br>
Such optimization of unchanging events might be good to consider further. Perhaps add prose to 19.2.2 such as<br>
<br>
"X3D players are not required to send unchanging intermediate values, providing a performance enhancement by avoiding the passing excessive superfluous events that have no effect."<br>
<br>
Similarly added a tooltip hint about that issue to interpolator node value_changed entries.<br>
<br>
        <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html#ColorInterpolator" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/toolt<wbr>ips/X3dTooltips.html#ColorInte<wbr>rpolator</a><br>
<br>
If we add those clarifications to specification, then perhaps (as originally expected) there is no need to add floating-point sequencers to the specification.  Given eight floating point interpolator nodes that possess such capabilities already in the specification, it is preferable to keep the node vocabulary as terse and concise as possible.<br>
<br>
The eight nodes in 19.2.2 are<br>
ColorInterpolator<br>
CoordinateInterpolator<br>
CoordinateInterpolator2D<br>
NormalInterpolator<br>
OrientationInterpolator<br>
PositionInterpolator<br>
PositionInterpolator2D<br>
ScalarInterpolator<br>
<br>
We need to similarly handle the other X3DInterpolatorNode:<br>
<br>
        25.3.7 GeoPositionInterpolator<br>
        <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geodata.html#GeoPositionInterpolator" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/geodata.html#<wbr>GeoPositionInterpolator</a><br>
<br>
Thanks for considering these issues.  Anything that we do to support and enhance author animation abilities is worthwhile and certainly holds broad value.<br>
<br>
p.s. of related interest: can build sequencers for nodes as well.  Examples:</blockquote></div></div></div></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_-101175558033131410quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div class="gmail-m_-101175558033131410elided-text"><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="gmail-m_-101175558033131410m_5098825802841159752quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
        <a href="http://x3dgraphics.com/examples/X3dForAdvancedModeling/Animation/ViewpointSequencerPrototypeIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForAdvancedModeling/Anima<wbr>tion/ViewpointSequencerPrototy<wbr>peIndex.html</a><br>
<br>
        <a href="http://x3dgraphics.com/examples/X3dForAdvancedModeling/Animation/CubeWithLabeledSidesViewpointSequencerIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForAdvancedModeling/Anima<wbr>tion/CubeWithLabeledSidesViewp<wbr>ointSequencerIndex.html</a><br>
<br>
        <a href="http://www.web3d.org/x3d/content/examples//Basic/Geospatial/CaliforniaCampusesIndex.html" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/conte<wbr>nt/examples//Basic/Geospatial/<wbr>CaliforniaCampusesIndex.html</a><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Sun, Sep 17, 2017 at 11:25 PM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a> <mailto:<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.co<wbr>m</a>>> wrote:<br>
<br>
    I am thinking about how to convert this example of a 4 state button from<br>
    scripting to event utilities:<br>
<br>
    <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptComplexStateEventsIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/example<wbr>s/X3dForWebAuthors/Chapter09-E<wbr>ventUtilitiesScripting/ScriptC<wbr>omplexStateEventsIndex.html</a><br>
    <<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptComplexStateEventsIndex.html" rel="noreferrer" target="_blank">http://x3dgraphics.com/exampl<wbr>es/X3dForWebAuthors/Chapter09-<wbr>EventUtilitiesScripting/Script<wbr>ComplexStateEventsIndex.html</a>><br>
<br>
    Using a Switch driven by an IntegerSequencer driven by the TouchSensor using<br>
    the next field would work but requires 4 full Shape nodes.<br>
<br>
    If there were a FloatSequencer, it would be possible to use it to provide<br>
    fractions to a ColorInterpolator to be fed into the bulb material. This<br>
    would be closer to the script and overall a more direct, and perhaps elegant<br>
    solution.<br>
<br>
    In general, with a FloatSequencer it would be possible to use all the<br>
    Interpolators as typed output, in effect converting from boolean.<br>
<br>
    Since such a FloatSequencer is very straightforward to implement (in x3dom<br>
    almost identical to IntegerSequencer) I will try this but wonder if such a<br>
    node had been proposed in the past?<br>
<br>
    I suspect that it would be almost trivial to add such a node to any browser<br>
    and suggest that it would enhance the utility of the event utilities<br>
    substantially, pun notwithstanding.<br>
<br>
    Any feedback or comment very welcome,<br>
<br>
    Andreas<br>
</blockquote>
all the best, Don<font color="#888888"><br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" value="+18316562149" target="_blank">+1.831.656.2149</a><br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzma<wbr>n</a><br>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</div>