[x3d-public] createStatement for SAI - multiple examples look quite similar, for nodes and statements

John Carlson yottzumm at gmail.com
Mon Jan 30 15:00:41 PST 2023


I’m going to go with what you suggest, and as a result, ignore the
createNode and createProto methods in SAI.

Are these used for external SAI?

I don’t really like factories anyway.   Dispatch tables seem to be okay!

If need be, I’ll synthesize a factory.

Thanks!

John

On Mon, Jan 30, 2023 at 2:21 PM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:

> John, every single one of the ~4000 scenes created for Java X3DJSAIL and
> Python x3d.py X3DPSAIL and JSON includes statement and node creation.  They
> are designed to follow the X3D SAI, as Joe indicates.
>
>
>
> Example abridged excerpts showing X3D, head and meta statements follow.
> Inquiring eyes will note that they have essentially identical structure,
> just different syntax for each programming language.
>
>
>
>    - *X3D Example Archives: X3D4AM, X3D for Advanced Modeling, Hello
>    World Scenes, Hello World*
>    -
>    https://x3dgraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorldIndex.html
>
>
>
>
>
>    -
>    https://x3dgraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorld.java
>
>
>
>   x3dModel = new
> X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_3)
>
>   .setHead(new head()
>
>     .addComments(" Alternate encodings: VRML97, X3D ClassicVRML Encoding,
> X3D Compressed Binary Encoding (CBE), X3DOM, JSON ")
>
>     .addMeta(new meta().setName(meta.NAME_TITLE
> ).setContent("HelloWorld.x3d"))
>
>     .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Simple
> X3D model example: Hello World!"))
>
>     .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("30
> October 2000"))
>
>     .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("11 June
> 2021")))
>
>   .setScene(new Scene()
>
>     .addComments(" Example scene to illustrate X3D nodes and fields (XML
> elements and attributes) ")
>
>     .addChild(new WorldInfo().setInfo(new String[] {"Example scene to
> illustrate a simple X3D model"}).setTitle("Hello World!"))
>
>
>
>
>
>    -
>    https://x3dgraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorld.python
>
>
>
> newModel=X3D(profile='Immersive',version='3.3',
>
>   head=head(
>
>     children=[
>
>     #  Alternate encodings: VRML97, X3D ClassicVRML Encoding, X3D
> Compressed Binary Encoding (CBE), X3DOM, JSON
>
>     meta(content='HelloWorld.x3d',name='title'),
>
>     meta(content='Simple X3D model example: Hello
> World!',name='description'),
>
>     meta(content='30 October 2000',name='created'),
>
>     meta(content='11 June 2021',name='modified')]),
>
>   Scene=Scene(
>
>     #  Example scene to illustrate X3D nodes and fields (XML elements and
> attributes)
>
>     children=[
>
>     WorldInfo(info=["Example scene to illustrate a simple X3D
> model"],title='Hello World!'),
>
>
>
>
>
>    -
>    https://x3dgraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorld.json
>
>
>
> { "X3D": {
>
>     "encoding":"UTF-8",
>
>     "@profile":"Immersive",
>
>     "@version":"3.3",
>
>     "@xsd:noNamespaceSchemaLocation":
> https://www.web3d.org/specifications/x3d-3.3.xsd,
>
>     "JSON schema":
> https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json
> ,
>
>     "head": {
>
>         "-children":[
>
>           {
>
>             "#comment":"Alternate encodings: VRML97, X3D ClassicVRML
> Encoding, X3D Compressed Binary Encoding (CBE), X3DOM, JSON"
>
>           }
>
>         ],
>
>         "meta": [
>
>           {
>
>             "@name":"title",
>
>             "@content":"HelloWorld.x3d"
>
>           },
>
>           {
>
>             "@name":"description",
>
>             "@content":"Simple X3D model example: Hello World!"
>
>           },
>
>           {
>
>             "@name":"created",
>
>             "@content":"30 October 2000"
>
>           },
>
>           {
>
>             "@name":"modified",
>
>             "@content":"11 June 2021"
>
>           }
>
>         ]
>
>     },
>
>     "Scene": {
>
>         "-children":[
>
>           {
>
>             "#comment":"Example scene to illustrate X3D nodes and fields
> (XML elements and attributes)"
>
>           },
>
>           { "WorldInfo":
>
>             {
>
>               "@info":["Example scene to illustrate a simple X3D model"],
>
>               "@title":"Hello World!"
>
>             }
>
>           },
>
>
>
>
>
>
>
> plus ça change…
>
> https://en.wiktionary.org/wiki/plus_ça_change
>
> 1.      (*literally
> <https://en.wiktionary.org/wiki/Appendix:Glossary#literally>*) The more
> it changes, the more it's the same thing (sometimes loosely translated as the
> more things change, the more they stay the same
> <https://en.wiktionary.org/wiki/the_more_things_change,_the_more_they_stay_the_same>
> ).
>
> 2.      Although the outward appearance may change, fundamentals are
> constant.
>
>
>
>
>
> 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 https://
> faculty.nps.edu/brutzman
>
>
>
> *From:* x3d-public <x3d-public-bounces at web3d.org> *On Behalf Of *Joseph D
> Williams
> *Sent:* Wednesday, January 25, 2023 9:48 AM
> *To:* John Carlson <yottzumm at gmail.com>; X3D Graphics public mailing list
> <x3d-public at web3d.org>
> *Subject:* Re: [x3d-public] createStatement for SAI
>
>
>
> Please look at the X3D Abstract SAI spec.
>
> Joe
>
>
>
> *From: *John Carlson <yottzumm at gmail.com>
> *Sent: *Tuesday, January 24, 2023 7:52 PM
> *To: *X3D Graphics public mailing list <x3d-public at web3d.org>
> *Subject: *[x3d-public] createStatement for SAI
>
>
>
> How is statement creation done in SAI?  How similar is it to node creation?
>
>
>
> Thanks,
>
>
>
> John
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230130/c42689b8/attachment-0001.html>


More information about the x3d-public mailing list