<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I Andreas,<div class=""><br class=""></div><div class="">I did get Vince’s suggestion of "InterpolatorNode.setFieldValue('set_fraction', ts_fraction)” to work. I will try your suggestion as well.</div><div class=""><br class=""></div><div class="">Regarding your suggestion of resetting startTime after scrubbing, I assume that this might be meant to set the new fraction of the TimeSensor to the scrubbed value.</div><div class=""><br class=""></div><div class="">However, this does not work for me. In fact, I can see no way to set a new fraction value for the TimeSensor when playing begins after scrubbing, given it’s specification:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class="">TimeSensor : X3DTimeDependentNode, X3DSensorNode {</font></div><div class=""><font face="Courier" class="">  SFTime  [in,out] cycleInterval    1     (0,∞)</font></div><div class=""><font face="Courier" class="">  SFBool  [in,out] enabled          TRUE</font></div><div class=""><font face="Courier" class="">  SFBool  [in,out] loop             FALSE</font></div><div class=""><font face="Courier" class="">  SFNode  [in,out] metadata         NULL  [X3DMetadataObject]</font></div><div class=""><font face="Courier" class="">  SFTime  [in,out] pauseTime        0     (-∞,∞)</font></div><div class=""><font face="Courier" class="">  SFTime  [in,out] resumeTime       0</font></div><div class=""><font face="Courier" class="">  SFTime  [in,out] startTime        0     (-∞,∞)</font></div><div class=""><font face="Courier" class="">  SFTime  [in,out] stopTime         0     (-∞,∞)</font></div><div class=""><font face="Courier" class="">  SFTime  [out]    cycleTime</font></div><div class=""><font face="Courier" class="">  SFTime  [out]    elapsedTime</font></div><div class=""><font face="Courier" class="">  SFFloat [out]    fraction_changed</font></div><div class=""><font face="Courier" class="">  SFBool  [out]    isActive</font></div><div class=""><font face="Courier" class="">  SFBool  [out]    isPaused</font></div><div class=""><font face="Courier" class="">  SFTime  [out]    time</font></div><div class=""><font face="Courier" class="">}</font></div></div><div class=""><br class=""></div><div class="">Am I missing something?</div><div class=""><br class=""></div><div class="">-Mike<br class="">
<div><br class=""><blockquote type="cite" class=""><div class="">On Dec 15, 2019, at 5:07 AM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" class="">andreasplesch@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class="">Hi Joe,<br class=""><br class="">Thanks for the memory jog. I recall doing it this way in pure VRML.<br class=""><br class="">What I can?t figure out is how to ?route? the output of the HTML slider into X3DOM's Interpolators. Is there an attribute in the x3dom runtime that I can set?<br class=""><br class="">-Mike<br class=""></blockquote><br class="">Hi Mike,<br class=""><br class="">as in Vince's example, you should be able use the set_fraction field<br class="">of the interpolator as attribute.<br class="">InterpolatorNode.setAttribute('set_field', newValuefromSlider) should<br class="">work.<br class=""><br class="">It might work to use a timesensor's fraction_changed as an _offset_ to<br class="">the last position of the slider when the play button was pressed.<br class=""><br class="">This probably means that the startTime of the timesensor needs to be<br class="">reset to now each time playing begins after scrubbing.<br class=""><br class="">-Andreas<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Dec 13, 2019, at 1:44 PM, Joseph D Williams <<a href="mailto:joedwil@earthlink.net" class="">joedwil@earthlink.net</a>> wrote:<br class=""><br class="">Hi Mike,<br class="">Same as to do a slider control in x3d?<br class="">You disconnect the TimeSensor and drive the Position and Orientation Interpolators with a number you derive from the slider, I think.<br class="">Joe<br class=""><br class="">From: Mike McCann <<a href="mailto:mccann@mbari.org" class="">mailto:mccann@mbari.org</a>><br class="">Sent: Friday, December 13, 2019 10:25 AM<br class="">To: x3dom mlist <<a href="mailto:x3dom-users@lists.sourceforge.net" class="">mailto:x3dom-users@lists.sourceforge.net</a>>; X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" class="">mailto:x3d-public@web3d.org</a>><br class="">Subject: [x3d-public] HTML slider and TimeSensor scrubbing behavior<br class=""><br class="">Hello,<br class=""><br class="">I have a TimeSensor that drives Position and Orientation Interpolators via ROUTEd fraction _changed and set_ events.<br class=""><br class="">The fraction_changed event out is also connected to an HTML slider (<input type=?range?>) via X3DOM?s onoutputchange() attribute.<br class=""><br class="">The HTML slider shows the progress of the animation, but I?d also like to use it to control the fraction of the animation, much like one can scrub through a video with a timeline slider.<br class=""><br class="">It seems that if I were able to set the fraction of the TimeSensor from the HTML slider I could achieve my goal, but there is not a set_fraction event in for it.<br class=""><br class="">Is there a best practice or any suggestions for how I may achieve my goal?<br class=""><br class="">Thanks in advance,<br class="">Mike<br class=""><br class="">P.S. Though my immediate need is to implement this in X3DOM, I?d think that this might be a common use case, so I?m cross-posting on x3d-public.<br class=""><br class="">--<br class="">Mike McCann<br class="">Software Engineer<br class="">Monterey Bay Aquarium Research Institute<br class="">7700 Sandholdt Road<br class="">Moss Landing, CA 95039-9644<br class="">Voice: 831.775.1769  Fax: 831.775.1736 <a href="http://www.mbari.org" class="">http://www.mbari.org</a><br class=""><br class=""><br class="">_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a> <<a href="mailto:x3d-public@web3d.org" class="">mailto:x3d-public@web3d.org</a>><br class=""><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a> <<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a>><br class=""></blockquote>-------------- next part --------------<br class="">An HTML attachment was scrubbed...<br class="">URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20191214/644683a6/attachment-0001.html" class="">http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20191214/644683a6/attachment-0001.html</a>><br class=""><br class="">------------------------------<br class=""><br class="">Message: 2<br class="">Date: Sat, 14 Dec 2019 16:44:12 -0500<br class="">From: "<a href="mailto:vmarchetti@kshell.com" class="">vmarchetti@kshell.com</a>" <<a href="mailto:vmarchetti@kshell.com" class="">vmarchetti@kshell.com</a>><br class="">To: Mike McCann <<a href="mailto:mccann@mbari.org" class="">mccann@mbari.org</a>><br class="">Cc: Joseph D Williams <<a href="mailto:joedwil@earthlink.net" class="">joedwil@earthlink.net</a>>, x3dom mlist<br class="">        <<a href="mailto:x3dom-users@lists.sourceforge.net" class="">x3dom-users@lists.sourceforge.net</a>>, X3D Graphics public mailing list<br class="">        <<a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a>><br class="">Subject: Re: [x3d-public] HTML slider and TimeSensor scrubbing<br class="">        behavior<br class="">Message-ID: <<a href="mailto:92904E9C-B23B-4B19-BE42-AA5F4F406C62@kshell.com" class="">92904E9C-B23B-4B19-BE42-AA5F4F406C62@kshell.com</a>><br class="">Content-Type: text/plain; charset="utf-8"<br class=""><br class="">Mike<br class=""><br class="">This sounds similar to a scene I worked on at <a href="http://www.kshell.com/pages/cmmpoc/index.html" class="">http://www.kshell.com/pages/cmmpoc/index.html</a> <<a href="http://www.kshell.com/pages/cmmpoc/index.html" class="">http://www.kshell.com/pages/cmmpoc/index.html</a>> . I've got three sliders feeding into 3 position interpolators,<br class="">Because I load my x3d as an external file I have to run a javascript after loading that looks through the DOM tree and finds those interpolators.<br class=""><br class="">But the relevant part for you I think, is to define a function which I call "moveInterpolator" and to set it as the handler for the 'oninput' method of the slider.<br class="">You can see it in the source html for page <a href="http://www.kshell.com/pages/cmmpoc/index.html" class="">http://www.kshell.com/pages/cmmpoc/index.html</a> <<a href="http://www.kshell.com/pages/cmmpoc/index.html" class="">http://www.kshell.com/pages/cmmpoc/index.html</a>><br class=""><br class="">Vince Marchetti<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Dec 14, 2019, at 4:29 PM, Mike McCann <<a href="mailto:mccann@mbari.org" class="">mccann@mbari.org</a>> wrote:<br class=""><br class="">Hi Joe,<br class=""><br class="">Thanks for the memory jog. I recall doing it this way in pure VRML.<br class=""><br class="">What I can?t figure out is how to ?route? the output of the HTML slider into X3DOM's Interpolators. Is there an attribute in the x3dom runtime that I can set?<br class=""><br class="">-Mike<br class=""><br class=""><blockquote type="cite" class="">On Dec 13, 2019, at 1:44 PM, Joseph D Williams <<a href="mailto:joedwil@earthlink.net" class="">joedwil@earthlink.net</a> <<a href="mailto:joedwil@earthlink.net" class="">mailto:joedwil@earthlink.net</a>>> wrote:<br class=""><br class="">Hi Mike,<br class="">Same as to do a slider control in x3d?<br class="">You disconnect the TimeSensor and drive the Position and Orientation Interpolators with a number you derive from the slider, I think.<br class="">Joe<br class=""><br class="">From: Mike McCann <<a href="mailto:mccann@mbari.org" class="">mailto:mccann@mbari.org</a>><br class="">Sent: Friday, December 13, 2019 10:25 AM<br class="">To: x3dom mlist <<a href="mailto:x3dom-users@lists.sourceforge.net" class="">mailto:x3dom-users@lists.sourceforge.net</a>>; X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" class="">mailto:x3d-public@web3d.org</a>><br class="">Subject: [x3d-public] HTML slider and TimeSensor scrubbing behavior<br class=""><br class="">Hello,<br class=""><br class="">I have a TimeSensor that drives Position and Orientation Interpolators via ROUTEd fraction _changed and set_ events.<br class=""><br class="">The fraction_changed event out is also connected to an HTML slider (<input type=?range?>) via X3DOM?s onoutputchange() attribute.<br class=""><br class="">The HTML slider shows the progress of the animation, but I?d also like to use it to control the fraction of the animation, much like one can scrub through a video with a timeline slider.<br class=""><br class="">It seems that if I were able to set the fraction of the TimeSensor from the HTML slider I could achieve my goal, but there is not a set_fraction event in for it.<br class=""><br class="">Is there a best practice or any suggestions for how I may achieve my goal?<br class=""><br class="">Thanks in advance,<br class="">Mike<br class=""><br class="">P.S. Though my immediate need is to implement this in X3DOM, I?d think that this might be a common use case, so I?m cross-posting on x3d-public.<br class=""><br class="">--<br class="">Mike McCann<br class="">Software Engineer<br class="">Monterey Bay Aquarium Research Institute<br class="">7700 Sandholdt Road<br class="">Moss Landing, CA 95039-9644<br class="">Voice: 831.775.1769  Fax: 831.775.1736 <a href="http://www.mbari.org" class="">http://www.mbari.org</a> <<a href="http://www.mbari.org/" class="">http://www.mbari.org/</a>><br class=""><br class=""><br class="">_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a> <<a href="mailto:x3d-public@web3d.org" class="">mailto:x3d-public@web3d.org</a>><br class=""><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a> <<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a>><br class=""></blockquote>_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a><br class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org<br class=""></blockquote><br class="">-------------- next part --------------<br class="">An HTML attachment was scrubbed...<br class="">URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20191214/19fe265d/attachment.html" class="">http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20191214/19fe265d/attachment.html</a>><br class=""><br class="">------------------------------<br class=""><br class="">Subject: Digest Footer<br class=""><br class="">_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a><br class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org<br class=""><br class=""><br class="">------------------------------<br class=""><br class="">End of x3d-public Digest, Vol 129, Issue 16<br class="">*******************************************<br class=""></blockquote><br class=""><br class=""><br class="">-- <br class="">Andreas Plesch<br class="">Waltham, MA 02453<br class=""><br class="">_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a><br class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org<br class=""></div></div></blockquote></div><br class=""></div></body></html>