[x3d-public] Scene Access Interface: autogenerating Python
John Carlson
yottzumm at gmail.com
Thu Aug 10 15:41:33 PDT 2017
My PythonSerializer.js converts JSON -> DOM -> Python.
What about an X3dToGeneric.xslt which takes a language as a parameter? My Java, JavaScript and Python serializers have a lot in common.
John
Sent from Mail for Windows 10
From: Don Brutzman
Sent: Thursday, August 10, 2017 5:31 PM
To: Myeong Won Lee; Masaki Aono; Roy Walmsley; John Carlson
Cc: X3D Graphics public mailing list
Subject: Scene Access Interface: autogenerating Python
Myeong Won Lee and Masaki Aono:
Thank you for meeting today to discuss X3D Object Model transformation by applying an XSLT stylesheet to autogenerate of SAI codebases.
Myeong Won Lee, I also thought that your Unity HAnim player is wonderful. I recommend that you include some examples in the public release, they will generate strong interest. Having some public examples while also allowing private examples provides appealing choices and the best possible support for your students.
Here is summary excerpted from this week's Web3D meeting report.
================================================================
3. Object Model for X3D (OM4X3D)
a. The Object Model for X3D (OM4X3D) is a full set of object-oriented interfaces for all nodes, fields and statements in the X3D Abstract Specification.
b. OM4X3D is produced by decorating the X3D XML Schema with carefully structured annotations that describe the entire object-oriented nature of the X3D scene graph. http://www.web3d.org/specifications/OM4X3D/ObjectModelForX3dCreation.png
c. Instantiation: Object Model for X3D definitions are explicitly listed in X3DObjectModel 3.3.xml with corresponding XML schema x3dObjectModel.xsd
d. Ongoing public/private dialog using the x3d-public at web3D.org mailing list and presentation at Web3D 2017 Conference has been productive. http://www.web3d.org/specifications/OM4X3D/ObjectModelForX3dMasterClassWeb3dConference2017June7.pdf
e. Demonstration of strict object model in X3D JSON Encoding, which is 98% complete and undergoing extensive review and testing, initial-draft specification has been prepared.
f. Initial implementations are available in JavaScript, Java, and C++. Also planning to prepare programming-language implementations for C, C#.
g. Two new versions for Python are started, with dialog occurring to discern best practices.
h. SAI no longer just Script node in Browser object, includes full application-oriented API. This will lead to some changes and generalizations in 19775-2 Abstract SAI specification.
i. Multiple emerging SAI specifications and implementations are shown on updated draft X3D Specifications Relationships diagram (attached)
j. Implementation: X3D JSON Loader (X3DJSONLD) https://github.com/coderextreme/X3DJSONLD
k. Implementation: X3D Java Scene Access Interface Library (X3DJSAIL) http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html
l. Under consideration: integration into X3D Abstract Specification 19775-1 to more thoroughly expand on current abstract interface hierarchy.
m. Emerging capability: coherent X3D center, multiple different programming languages that offer common design patterns to programmers to create identical scene graphs.
================================================================
The essence of autogeneration is that proper code patterns must first exist. Once we get a few classes with the design patterns of interest, and generation of a few classes, then creation of all classes follows in a straightforward manner.
I recommend that the first example we work with is HelloWorld.x3d into .c .cpp .cs and .py source.
http://www.web3d.org/x3d/content/examples/HelloWorld.x3d
http://www.web3d.org/x3d/content/examples/HelloWorld.html
Regarding Python: John Carlson has done intriguing work that auto-translates Java source in X3DJSAIL to Python. This is interesting because it would keep the codebases closely aligned, making it easier to learn and debug. Consistency is easily maintained across X3D versions and X3D bugfixes by re-running each distribution. Flexibility is also possible since each codebase will include custom utility classes, methods and examples.
Next steps for Python: recommend that we
- Examine Masaki's work and compare it with the pyjnius conversions.
- Autogenerate Python library (X3DPSAIL perhaps?) to provide Python codebase support.
- Iterate until we have a good design pattern for HelloWorld and other exemplars.
- Create an X3dToPython.xslt stylesheet that can convert someModel.x3d to someModel.py source.
- run that across all scenes X3D Example Archives, detect and resolve errors, publish builds.
- make T-shirts 8)
As with JavaScript and Java, it is good to use the x3d-public list for this work. Also suitable for a weekly update reports and monthly telcon item for X3D Working Group.
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170810/229d1391/attachment.html>
More information about the x3d-public
mailing list