[x3d-public] X3DJSAIL updates
Don Brutzman
brutzman at nps.edu
Sun Dec 17 11:03:24 PST 2017
On 12/17/2017 10:29 AM, John Carlson wrote:
> I believe this happens because -children is generated instead of -material in the Java -> JSON generation. I don’t believe -children is valid at this point, since addChild is also unavailable.
There is no special Java -> JSON generation on my end, only X3dToJSON.xslt invocation.
JSON validation can help with this sort of thing. As shown by JSON schema documentation, there is a -children field but it is only for immediate-child contained comments and ROUTEs.
http://www.web3d.org/specifications/X3dJsonSchemaDocumentation3.3/x3d-3.3-JSONSchema_Appearance.html#Link3
> (See Java code generated from HelloWorldProgramOutput.java—does not compile).
> Also getting error at toStringJava, so I can’t really test anything—fix this first, then get back to me):
This method was added this morning and deployed in .jar files etc. prior to my earlier email.
Now committed in CreateX3dSceneAccessInterfaceJava.xslt autogenerator as well.
> test-nashorn:
>
> [javac] Compiling 2 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
>
> [javac] C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgram.java:193: error: cannot find symbol
>
> [javac] System.out.println (x3dModel.toStringJava());
>
> [javac] ^
>
> [javac] symbol: method toStringJava()
>
> [javac] location: variable x3dModel of type X3DObject
>
> [javac] 1 error
>
> This does not produce anything or errors:
>
> $ java -cp "java/examples;java/jars/X3DJSAIL.3.3.full.jar" HelloWorldProgramOutput java foo.java
>
> HelloWorldProgramOutput self-validation test results: success
>
> Please advise as to correct invocation. Thanks!
>
> I will try to add a mapping from -children to -material. I don’t think this is correct though, and will cause issues.
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>
> *From: *Don Brutzman <mailto:brutzman at nps.edu>
> *Sent: *Sunday, December 17, 2017 11:45 AM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *Re: [x3d-public] X3DJSAIL updates
>
> On 12/16/2017 11:47 PM, John Carlson wrote:
>
> > $ jjs -cp ../../java/jars/X3DJSAIL.3.3.full.jar HelloWorldProgramOutput.js
>
> >
>
> > HelloWorldProgramOutput.js:128 TypeError: new AppearanceObject().setDEF("TestAppearance1").setProtoInstance is not a function
>
> correct, .setProtoInstance is not a function
>
> see AppearanceObject javadoc for provided methods. You won't find any setProtoInstance() methods anywhere, rather look for setMaterial(new ProtoInstanceObject()) methods.
>
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list