<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 19, 2016 at 12:49 PM, Leonard Daly <span dir="ltr"><<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="m_2422218465261313591moz-cite-prefix">On 12/19/2016 8:36 AM, Andreas Plesch
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Thanks Roy,
        <div><br>
        </div>
        <div>the next step may be to come up with a simple test scene
          (as I could not find any in the x3d examples collection) and
          check how different x3d browsers behave.</div>
        <div><br>
        </div>
        <div>A directly related question is how x3d/vrml scenes managed
          pausing of animations before pause/resumeTime was introduced ?
          If there is a well known strategy/method for pausing, this
          issue may become almost irrelevant. </div>
      </div>
    </blockquote>
    <br>
    What I did was to create a TimeSensor with a cycleInterval of 1.
    That was ROUTEd to a Script where all of the time control happened.
    I may have had a 1 second granularity on my controls - I don't
    remember the details. If you want continuous control (at least down
    to 0.01 seconds), then it can get a little messy to deal with all of
    the different possibilities. <br>
    <br>
    I believe I set it up so the single TimeSensor drove as many
    pseudo-TimeSensors as I needed. The calculation was in a local
    function and controls and output events were manually added to the
    structure as needed.<br>
    <br>
    It seems overkill to require a Script to do something pretty basic.
    Unfortunately, we didn't fully appreciate the fundamental change we
    were making to time.<br>
    <br></div></blockquote><div><br></div><div>Ok, I just was not sure if there is some basic, easy method for pausing. It looks there is not, and that was motivation to introduce the pausing related fields.</div><div><br></div><div>-Andreas</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    Leonard Daly<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>But it seems pausing would involve stopping, and then
          restarting with a startTime at the appropriate time in the
          past:</div>
        <div><br>
        </div>
        <div>timeOffset = fraction_changed_whenStopped * cycleInterval</div>
        <div>startTime = now - timeOffset</div>
        <div><br>
        </div>
        <div>Setting startTime of an inactive sensor to a time in the
          past seems to be allowed.</div>
        <div><br>
        </div>
        <div>This looks like it would require scripting, and does make a
          built in pausing functionality more attractive.</div>
        <div><br>
        </div>
        <div>-Andreas</div>
        <div>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">On Mon, Dec 19, 2016 at 10:30 AM,
              Roy Walmsley <span dir="ltr"><<a href="mailto:roy.walmsley@ntlworld.com" target="_blank">roy.walmsley@ntlworld.com</a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div link="blue" vlink="purple" lang="EN-GB">
                  <div class="m_2422218465261313591m_-995318895132284460WordSection1">
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Hi
                        Andreas and Leonard,</span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">This
                        is an interesting topic to capture for
                        subsequent discussion and resolution. Thank you
                        Andreas for raising it. </span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I
                        have, therefore, raised a Mantis issue based on
                        Andreas’ original comment, to which I have
                        appended Leonard’s reply and Andreas’ subsequent
                        response as notes.  The Mantis issue is 1106. It
                        is available for Web3D members at <a href="http://web3d.org/pipermail/x3d-public_web3d.org/2016-December/005692.html" target="_blank">http://web3d.org/pipermail/x3d<wbr>-public_web3d.org/2016-Decembe<wbr>r/005692.html</a>.</span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Regards,</span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Roy</span></p>
                    <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></p>
                    <p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" lang="EN-US"> x3d-public [mailto:<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web<wbr>3d.org</a>]
                        <b>On Behalf Of </b>Andreas Plesch<br>
                        <b>Sent:</b> 17 December 2016 03:53<br>
                        <b>To:</b> Leonard Daly <<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>><br>
                        <b>Cc:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
                        <b>Subject:</b> Re: [x3d-public] TimeSensor
                        resumeTime field</span></p>
                    <p class="MsoNormal"> </p>
                    <p>Leonard,</p>
                    <p>On Dec 16, 2016 8:52 PM, "Leonard Daly" <<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>>
                      wrote:<br>
                      ><br>
                      > [Note: I am OK with this being posted to
                      x3d-public. I did not do so because it is
                      originally Andreas' comment.]<br>
                      ><br>
                      > The answer depends on what is meant by a
                      TimeSensor. Up until V3.2 (when pause was
                      introduced), TimeSensor was always real-world time
                      -- we didn't have a Dick Tracy watch that would
                      pause (most) of the world. When pause was
                      introduced, the intent was to create a pause in
                      the progression of time, similar to a "Pause"
                      button on tape/VCR/CD/DVD/Netflix... player. I
                      believe that to be the desired behavior based on
                      my memory of the discussions.</p>
                    <p>The history is interesting and may explain the
                      friction between the rigid fraction_changed
                      formula and the expected resume behavior.
                      elapsedTime explicitly excludes paused intervals.
                      Would then a formula</p>
                    <p>fraction_changed = elapsedTime mod cycleInterval
                      / cycleInterval</p>
                    <p>work to define fraction_changed ?</p>
                    <p>I did not test other x3d browsers resumeTime
                      behavior. Is there a conformance test scene ?</p>
                    <p>> TimeSensor "senses" the passage of time and
                      takes certain actions based on its internal
                      (field) settings. This includes start, stop,
                      pause, and resume. It also emits system time at
                      certain points ('cycleTime' at the beginning of
                      each cycle/loop and 'time' for event timestep).
                      Except for these two fields everything else is
                      relative (either a fraction or seconds of
                      running-time).</p>
                    <p>Ok, let's take the opportunity to review the time
                      component. </p>
                    <p>> What would it take to eliminate the system
                      time from TimeSensor?</p>
                    <p>System time is the same for all nodes within a
                      scene and across scenes on the same system, so it
                      does seem to play an important role, no ?</p>
                    <p>> Obviously the startTime, stopTime,
                      pauseTime, and resumeTime fields would need to
                      change for controlling the sensor. The cycleTime
                      field would not apply or perhaps it would be
                      'elapsedTime' when the loop restarts. The 'time'
                      field is currently represented by elapsedTime for
                      units of total seconds or fraction_changed for the
                      fractional portion of the loop. Perhaps this could
                      be extended to include the # times through the
                      loop (e.g., instead of .3, it would be 2.3
                      indicating two full loops + .3 through the third
                      loop).</p>
                    <p>The fractional portion only is needed for
                      interpolators. Unless Yves suggestion for simple
                      arithmetic expressions is adopted. An additional
                      output field 'elapsedCycles' is another option.</p>
                    <p>> The fields the control the input (startTime,
                      stopTime, pauseTime, and resumeTime) would need to
                      change (by function or replaced by a new field) to
                      either indicate an operation (start, stop, pause,
                      resume) or some sort of relative time in the
                      world. Most everything is based on user action to
                      initiate an in-world action. The biggest issue (I
                      see) is synchronizing actions between multiple
                      users. I don't think TimeSensor is the right way
                      to do this anyway as TimeSensor depends on the
                      local computer's clock and there is no guarantee
                      that the time is correct or intervals are
                      accurate.</p>
                    <p>Synchronization requires synchronization of
                      clocks at some point. Should there be a way to do
                      this in x3d ? Intervals should be assumed to be
                      reliable across systems (or all hope is lost?).</p>
                    <p>Andreas <br>
                      ><br>
                      > Leonard Daly<br>
                      ><br>
                      ><br>
                      ><br>
                      >> A time sensor has a concept of pausing
                      time:<br>
                      >><br>
                      >> <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/time.html#PausingTime" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/<wbr>Part01/components/time.html#Pa<wbr>usingTime</a><br>
                      >><br>
                      >> When now reaches a pauseTime, the
                      TimeSensor is put into a paused mode. It then
                      resumes to generate output events such as
                      fraction_changed when now reaches a resumeTIme.<br>
                      >><br>
                      >> My question is if when resumeTime is
                      reached, generated fraction_changed values should
                      continue from where they were when the sensor was
                      paused. To me this behaviour seems to be the
                      intent of the pausing concept.<br>
                      >><br>
                      >> "The time-dependent node then resumes
                      generating its output events from the paused state
                      at the simulation tick." is the spec. language.  <br>
                      >><br>
                      >> On the other hand, the formula given to
                      calculate fraction_changed includes the difference
                      between now and the startTime. In order to keep
                      using this formula, startTime would need to be
                      (internally) adjusted after resuming a paused
                      sensor such that fraction_changed equals
                      fraction_changed at pauseTime. Does adjusting the
                      startTime constitute a change of the paused state
                      ?<br>
                      >><br>
                      >> x3dom currently does not continue
                      fraction_changed from where it was paused.
                      Instead, it just continues the output as if the
                      sensor was never paused, eg. does not adjust
                      startTime.<br>
                      >><br>
                      >> -Andreas<br>
                      >><br>
                      >><br>
                      >><br>
                      >><br>
                      >><br>
                      >><span class="m_2422218465261313591HOEnZb"><font color="#888888"><br>
                          >><br>
                          >> -- <br>
                          >> Andreas Plesch<br>
                          >> 39 Barbara Rd.<br>
                          >> Waltham, MA 02453<br>
                          >><br>
                          >><br>
                          >> ______________________________<wbr>_________________
                          x3d-public mailing list <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank">http://web3d.org/mailman/listi<wbr>nfo/x3d-public_web3d.org</a>
                          <br>
                          ><br>
                          ><br>
                          ><br>
                          > -- <br>
                          > Leonard Daly<br>
                          > 3D Systems & Cloud Consultant<br>
                          > LA ACM SIGGRAPH Chair<br>
                          > President, Daly Realism - Creating the
                          Future</font></span></p>
                  </div>
                </div>
              </blockquote>
            </div>
            <br>
            <br clear="all"><span class="HOEnZb"><font color="#888888">
            <div><br>
            </div>
            -- <br>
            <div class="m_2422218465261313591gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>
              39 Barbara Rd.<br>
              Waltham, MA 02453</div>
          </font></span></div><span class="HOEnZb"><font color="#888888">
        </font></span></div><span class="HOEnZb"><font color="#888888">
      </font></span></div><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <p><br>
    </p>
    <div class="m_2422218465261313591moz-signature">-- <br>
      <font class="m_2422218465261313591tahoma,arial,helvetica m_2422218465261313591san m_2422218465261313591serif" color="#333366">
        <font size="+1"><b>Leonard Daly</b></font><br>
        3D Systems & Cloud Consultant<br>
        LA ACM SIGGRAPH Chair<br>
        President, Daly Realism - <i>Creating the Future</i>
      </font></div>
  </font></span></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div>