<div dir="ltr"><div><div><div>Thanks, I updated the example at<br><br><a href="http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml" target="_blank">http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml</a><br><br></div>a bit to show how one could use web page DOM scripting to have similar functionality as provided in the original x3d scripting/routing.<br></div>I also should clarify that touchsensor is supported in x3dom but if you want to use scripting it is usually replaced by the onclick event function.<br><br></div><div>-Andreas<br></div><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 6:13 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><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Andreas,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Your work below is very timely! Script node handling is under serious consideration at the moment with respect to the next version of the specifications. So we will look at your examples with great interest. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Roy<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> x3d-public [mailto:<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web3d.org</a>] <b>On Behalf Of </b>Andreas Plesch<br><b>Sent:</b> 16 September 2015 08:30<br><b>To:</b> X3D Graphics public mailing list<br><b>Subject:</b> [x3d-public] x3d script to x3dom scripting example<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Since I had a need to fix proper text alignment in x3dom, I ported the Nist conformance text driver example scene:<br><br><a href="http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.html" target="_blank">http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.html</a><br><br><a href="http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.js" target="_blank">http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.js</a><u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">to x3dom. It uses touchsensors and a x3d javascript script to modify the text font style alignment fields. Both nodes, touchsensor and script are not supported directly in x3dom. Instead one can use native web browser functionality for a x3dom style scene access interface. The ported scene is here:<br><br><a href="http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml" target="_blank">http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml</a><u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">I added some commenting in the x3d scene to point out what was necessary both in the xml and in the javascript.<u></u><u></u></p><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Here are source views:<br><br><a href="https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.xhtml" target="_blank">https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.xhtml</a><br><a href="https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.js" target="_blank">https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.js</a><u></u><u></u></p></div><div><p class="MsoNormal">One could probably find more elegant code but this tries to stick closely to the original.<br clear="all"><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">One can see that some work is involved in the porting to define the interface but the main functionality remains as is.<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Hopefully this can help as a starting point if there is a need to convert existing, scripted x3d scenes to x3dom,  for example to integrate more tightly with a surrounding web page.<u></u><u></u></p></div><div><p class="MsoNormal">Andreas<u></u><u></u></p></div><div><p class="MsoNormal"><br>-- <u></u><u></u></p><div><p class="MsoNormal">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453<u></u><u></u></p></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>