<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 29, 2020 at 8:43 AM Don Brutzman <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">John, hoping to understand better when we meet again Monday.  Not fully following.<br>
<br>
You are welcome to do anything with Javascript and Node work within X3DJSAIL and we can ensure documentation/examples remain current.<br>
<br></blockquote><div>Okay.  I will need to work on documentation for toFileJavaScript (there are 2 of them).  I will simply copy over and modify docs for Java if that's okay?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> I believe this is a problem with the X3dToNodeJS.xslt.  If you want Don, I can go ahead and repair the stylesheet as well, but awaiting your permission.<br>
<br>
I have not done anything (maybe ever) with that stylesheet.  You are of course welcome to improve/evolve it.<br></blockquote><div><br></div><div>Okay, I think I can do that. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
As before, the central issue driving everything else is defining examples for X3D SAI JavaScript/EcmaScript programs that can run standalone in Node.js.  Until we get clear on that, have no way to assess whether any other work is adding value.<br></blockquote><div><br></div><div>Yes, repeat, sorry:</div><div><br></div><div><a href="https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data">https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data</a></div><div><br></div><div>All my NodeSerializer.js examples.   Many run, and some don't run, similar to Java examples.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Hoping to get clear on that, what does end result look like.  Let's be deliberate about this please.<br></blockquote><div><br></div><div>I suggest either a X3DJSAIL-like SAI, or perhaps an es6 based sai, with a new library.  I can continue working on es6 in a github repository if you like?  Plus add a serializer or stylesheet for ES6-NodeJS?</div><div><br></div><div>I do think it's good to provide a Nashorn alternative.  That was my primary understanding from you.</div><div><br></div><div>I'm going to send another error report on a JavaScript output and then check my work in.  We can revisit on Monday.</div><div><br></div><div>John </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Very respectfully yours.<br>
<br>
On 5/28/2020 4:07 PM, John Carlson wrote:<br>
> LOL! forgot the bug!   I believe this is left over from Nashorn API. I think once we fix JavaScript output from X3DJSAIL, this file will get overwritten.<br>
> <br>
> $ node examples/HelloWorldProgramOutput.Node.js<br>
> C:\x3d-code\<a href="http://www.web3d.org" rel="noreferrer" target="_blank">www.web3d.org</a> <<a href="http://www.web3d.org" rel="noreferrer" target="_blank">http://www.web3d.org</a>>\x3d\stylesheets\java\node\examples\HelloWorldProgramOu<br>
> tput.Node.js:58<br>
>            .addChild(new autoclass.Viewpoint().setDEF("TopDownView").setDescripti<br>
> on("top-down view from above").setOrientation(<a href="http://java.to" rel="noreferrer" target="_blank">java.to</a> <<a href="http://java.to" rel="noreferrer" target="_blank">http://java.to</a>>([1,0,0,-1.570796], java.ty<br>
> pe("float[]"))).setPosition(<a href="http://java.to" rel="noreferrer" target="_blank">java.to</a> <<a href="http://java.to" rel="noreferrer" target="_blank">http://java.to</a>>([0,100,0], java.type("float[]")))))<br>
> <br>
>                                                                                ^<br>
> <br>
> TypeError: java.type is not a function<br>
>      at Object.<anonymous> (C:\x3d-code\<a href="http://www.web3d.org" rel="noreferrer" target="_blank">www.web3d.org</a> <<a href="http://www.web3d.org" rel="noreferrer" target="_blank">http://www.web3d.org</a>>\x3d\stylesheets\java\node\e<br>
> xamples\HelloWorldProgramOutput.Node.js:58:159)<br>
> ?[90m    at Module._compile (internal/modules/cjs/loader.js:1176:30)?[39m<br>
> ?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:1<br>
> 0)?[39m<br>
> ?[90m    at Module.load (internal/modules/cjs/loader.js:1040:32)?[39m<br>
> ?[90m    at Function.Module._load (internal/modules/cjs/loader.js:929:14)?[39m<br>
> ?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma<br>
> in.js:71:12)?[39m<br>
> ?[90m    at internal/main/run_main_module.js:17:47?[39m<br>
> <br>
> On Thu, May 28, 2020 at 6:05 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a> <mailto:<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>> wrote:<br>
> <br>
>     Found a bug in:<br>
> <br>
>     <a href="http://www.web3d.org/x3d/stylesheets/java/node" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/node</a> <<a href="http://www.web3d.org/x3d/stylesheets/java/node" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/stylesheets/java/node</a>>!<br>
> <br>
>     I believe this is due to X3DJSAIL no longer emitting JavaScript.<br>
> <br>
>     We can either delete the example from the build, or add the X3dToNodeJS.xslt to the to*JavaScript() functions in X3DJSAIL (recommended):<br>
> <br>
>     $ grep -i javascript'('  CreateX3dSceneAccessInterfaceJava.xslt|grep public<br>
>              public String toStringJavaScript()<br>
>          public File toFileJavaScript(String fileName)<br>
> <br>
>     This is a effort replace the nashorn output from X3DJSAIL.   We are now supporting nodejs instead since Nashorn has been deprecated by Oracle.<br>
> <br>
>     I kind of think the main purpose of the nodejs output is to have a alternate to Java for things like large methods.  Plus, we don't have a good python-X3DJSAIL solution.<br>
> <br>
>     It's a good test of the FFI, and supports node.js processing on the server, for those that choose that route.<br>
> <br>
>     The solution on the browser is to write an es6 x3d.mjs library (TBD--partly done).<br>
> <br>
>     Thanks,<br>
> <br>
>     John<br>
> <br>
>     On Thu, May 28, 2020 at 5:37 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a> <mailto:<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>> wrote:<br>
> <br>
>         I fixed the bug in<br>
> <br>
>         <a href="http://www.web3d.org/x3d/stylesheets/java/node" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/node</a> <<a href="http://www.web3d.org/x3d/stylesheets/java/node" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/stylesheets/java/node</a>>!<br>
> <br>
>         Diff:<br>
> <br>
>         $ svn diff examples/HelloWorldProgramOutput.js<br>
>         Index: examples/HelloWorldProgramOutput.js<br>
>         ===================================================================<br>
>         --- examples/HelloWorldProgramOutput.js (revision 30476)<br>
>         +++ examples/HelloWorldProgramOutput.js (working copy)<br>
>         @@ -19,7 +19,7 @@<br>
>           var ProtoInstance4 = null;<br>
>           var ProtoInstance5 = null;<br>
>           var ProtoInstance6 = null;<br>
>         -      var X3D0 =  new autoclass.X3D().setProfile("Immersive").setVersion("3.3")<br>
>         +      var X3D0 =  (new autoclass.X3D()).setProfile("Immersive").setVersion("3.3")<br>
>                 .addComments(new autoclass.CommentsBlock(" x3dVersionComparisonTest for this model: supportsX3dVersion(X3DObject.VERSION_3_0)=true "))<br>
>                 .setHead(new autoclass.head()<br>
>                   .addComments(new autoclass.CommentsBlock(" comment #1 "))<br>
> <br>
>         Will check in soon.<br>
> <br>
>         I believe this is a problem with the X3dToNodeJS.xslt.  If you want Don, I can go ahead and repair the stylesheet as well, but awaiting your permission.<br>
> <br>
>         Thanks,<br>
> <br>
>         John<br>
> <br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br>
</blockquote></div></div>