[x3d-public] x3d script to x3dom scripting example
Andreas Plesch
andreasplesch at gmail.com
Fri Sep 18 04:53:09 PDT 2015
Thanks, I updated the example at
http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml
a bit to show how one could use web page DOM scripting to have similar
functionality as provided in the original x3d scripting/routing.
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.
-Andreas
On Wed, Sep 16, 2015 at 6:13 AM, Roy Walmsley <roy.walmsley at ntlworld.com>
wrote:
> Andreas,
>
>
>
> 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.
>
>
>
> Regards,
>
>
>
> Roy
>
>
>
> *From:* x3d-public [mailto:x3d-public-bounces at web3d.org] *On Behalf Of *Andreas
> Plesch
> *Sent:* 16 September 2015 08:30
> *To:* X3D Graphics public mailing list
> *Subject:* [x3d-public] x3d script to x3dom scripting example
>
>
>
> Since I had a need to fix proper text alignment in x3dom, I ported the
> Nist conformance text driver example scene:
>
>
> http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.html
>
>
> http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/driver.js
>
> 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:
>
> http://andreasplesch.github.io/x3dom/x3dom_text/driver_x3dom.xhtml
>
> I added some commenting in the x3d scene to point out what was necessary
> both in the xml and in the javascript.
>
> Here are source views:
>
>
> https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.xhtml
>
> https://github.com/andreasplesch/x3dom/blob/gh-pages/x3dom_text/driver_x3dom.js
>
> One could probably find more elegant code but this tries to stick closely
> to the original.
>
>
>
> One can see that some work is involved in the porting to define the
> interface but the main functionality remains as is.
>
> 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.
>
> Andreas
>
>
> --
>
> Andreas Plesch
> 39 Barbara Rd.
> Waltham, MA 02453
>
--
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150918/5e6e0d44/attachment.html>
More information about the x3d-public
mailing list