[x3d-public] ECMAScript 6 X3D API

John Carlson yottzumm at gmail.com
Mon Nov 1 11:10:53 PDT 2021


Joe, as you are probably aware, your example probably does not work in some
browsers.   I am not a browser developer.  I still don’t think that Script
fields are hooked up with ROUTEs yet in X3DOM.   That is a major problem
that may or may not affect X_ITE, but in my testing, I couldn’t see that
any clicking worked.

I did write some script to route interactions in X3DJSONLD’s Script.js.   I
do not know how applicable that is to anything, except my own animations.

I understand Web3d has goals of getting the standard working on the WWW.
I do not see any structure within the organization which will track tasks
for software and keep people accountable, except for standards oriented
tasks.


My focus has been getting JSON working.   I need to continue to do that, or
my code will rot.

I have 1 primary goal:  1) get Ajv 8.6.3 or other JSON validator working on
the web.   The move to JSON Schema 2020-12 was not well informed as Ajv
does not currently have a web solution, and the python validators are slow
or don’t work.  I believe that the Java solutions may be adequate, but the
ant script in x3dschema repository does throw warnings I believe.

We do need a way to sent many JSON files to the validator.   I don’t
currently know how to do this with an ant script and I hope to accomplish
this task this afternoon.

In other words, I am pretty busy keeping the JSON message going.




On Sun, Oct 31, 2021 at 6:55 PM Joseph D Williams <joedwil at earthlink.net>
wrote:

>
>
> Looks like great stuff if I as a simple user of the x3d ecmascript SAI
> ever needed to know about it in order to create and use x3d Script node.
>
> All I want to know is will this example work.
>
>
>
>
>
> ISO/IEC 19775-2 Index page (web3d.org)
> <https://www.web3d.org/documents/specifications/19775-2/V3.3/index.html>
>
>
>
> https://www.web3d.org/documents/specifications/19775-2/V3.3/index.html
>
>
>
> ISO/IEC 19777-1 Edition 2 -- X3D ECMAScript binding (web3d.org)
> <https://www.web3d.org/documents/specifications/19777-1/V3.3/index.html>
>
>
>
> https://www.web3d.org/documents/specifications/19777-1/V3.3/index.html
>
> ISO/IEC 19776-1:2015 — X3D XML encoding — Index (web3d.org)
> <https://www.web3d.org/documents/specifications/19776-1/V3.3/index.html>
>
>
> https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/examples.html#ScriptingExample
>
> Here is the example:
>
> *<?xml version="1.0" encoding="utf-8"?>*
>
> *<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"*
>
> *  "http://www.web3d.org/specifications/x3d-3.0.dtd <http://www.web3d.org/specifications/x3d-3.0.dtd>">*
>
>
>
> *<X3D version='3.0' profile='Immersive'>*
>
> *  <head>*
>
> *    <meta name='filename' content='Scripting.x3d'/>*
>
> *  </head>*
>
> *  <Scene>*
>
> *    <Script DEF='OpenVault'>*
>
> *      <field name='openVault' type='SFTime' *
>
> *             accessType='inputOnly'/>*
>
> *      <field name='combinationEntered' type='SFBool' *
>
> *             accessType='inputOnly'/>*
>
> *      <field name='vaultUnlocked' type='SFTime' *
>
> *             accessType='outputOnly'/>*
>
> *      <field name='unlocked' type='SFBool' value='false' *
>
> *             accessType='initializeOnly' />*
>
> *      <![CDATA[*
>
> *      ecmascript:*
>
> *      function combinationEntered (value) {*
>
> *        unlocked = value;*
>
> *      }*
>
> *      function openVault(value) {*
>
> *      if (unlocked) vaultUnlocked = value;*
>
> *      }*
>
> *      ]]>*
>
> *    </Script>*
>
> *    <Shape>*
>
> *      <Appearance>*
>
> *        <Material diffuseColor='1 0 0'/>*
>
> *      </Appearance>*
>
> *      <Sphere/>*
>
> *    </Shape>*
>
> *    <Sound maxBack='1000' maxFront='1000' minBack='1000' minFront='1000'>*
>
> *      <AudioClip DEF='Click' stopTime='1' *
>
> *        description='clicking sound' url='"click.wav"'/>*
>
> *    </Sound>*
>
> *    <TouchSensor DEF='TS'/>*
>
> *    <ROUTE fromNode='TS' fromField='isOver' *
>
> *           toNode='OpenVault' toField='combinationEntered'/>*
>
> *    <ROUTE fromNode='TS' fromField='touchTime' *
>
> *           toNode='OpenVault' toField='openVault'/>*
>
> *    <ROUTE fromNode='OpenVault' fromField='vaultUnlocked' *
>
> *           toNode='Click' toField='startTime'/>*
>
> *  </Scene>*
>
> *</X3D>*
>
>
>
> Click here <https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/Examples/Scripting.x3d> to view this example in a 3D scene window.
>
>
>
> If already ok for some tools please tell me:
>
> How can we best be sure that when that ‘Click here’ in the spec or in this note gets made, that it works as described using any competent html Dom webGL ecmascript browser, not in a sandbox (at least show the geometry and retrieve that .wav), free to interact with the rest of our WWW.
>
>
>
> Thanks for all,
>
> Joe
>
>
>
>
>
> *From: *John Carlson <yottzumm at gmail.com>
> *Sent: *Sunday, October 31, 2021 1:16 PM
> *To: *x3d-public at web3d.org
> *Subject: *[x3d-public] ECMAScript 6 X3D API
>
>
>
> More work done on es6x3d:
>
>
>
> https://GitHub.com/coderextreme/es6x3d
>
>
>
> Changes for MFString, and other MF work.
>
>
>
> Still lots of work to do, including possible export to three.js
>
>
>
> John
>
>
>
> _______________________________________________
>
> x3d-public mailing list
>
> x3d-public at web3d.org
>
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211101/e269d27c/attachment-0001.html>


More information about the x3d-public mailing list