[x3d-public] Trying again. Sourceforge isn't working for me. X3DJSAIL Java Output Output. Remove setDEF()/setUSE()?
John Carlson
yottzumm at gmail.com
Thu Jul 17 04:16:19 PDT 2025
Summary:
Get correct skin/skinCoord Coordinate node DEF/USE order for BoxMan4.java
output output [sic]. And test with Michalis' tools.
https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skin/BoxMan4Index.html
Running the Java on that page produces these two files:
Skin/BoxMan4_JavaExport.x3d
Skin/BoxMan4_JavaExport.x3dv
Neither of them pass castle-model-converter or castle-model-viewer.
Please use the X3DJSAIL CommandLine validate to see some of the warnings,
but the one's I'm interested in and want to debug are the errors that
castle-model-converter and castle-model-viewer produce. If I pass those,
then I have a chance of rendering.
Compare with the original BoxMan4 which renders fine in
castle-model-converter and sunrize:
https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skin/BoxMan4.x3d
So, I would say that either 1) X3dToJava.xslt in X3DJSAIL produces bad Java
(I think it's okay, but not having USE or DEF in the Java might be an
option), or X3DJSAIL is producing/exporting bad X3D and X3DV (via the
BoxMan4.java program, due to Coordinate node orderiing with DEF/USE).
I am attaching a zip with a log that shows my experiments. I did modify
the Java slightly, but you can compare with the web page. Note that most
of the errors are info, with a couple of warnings.
The primary reason, AFAICT in X3D and X3DV exports, for the errors, is USE
before DEF in the Humanoid, particularly Coordinate USE/DEF (skinCoord and
skin Coordinates). I encourage you to use xsl:sort in the X3DJSAIL
creation stylesheet, or some way to make sure that DEF comes before USE. I
think the field order one must worry about is to *make your choice on skin
vs skinCoord field ordering on output from Java. * My goal would be to
follow the order of the .x3d in the archive.
Please choose which order you like and make sure your BoxMan4.java output
views, just like the original BoxMan4.x3d. I suggest using the same order
of fields as appear in your X3D input to create Java.
Sorry it took so long to explain this. I don't want to maintain my own
copy of X3DJSAIL. I used a copy downloaded from the X3DJSAIL website.
The zip contains a log file from running Castle/javac/java and .x3dv and
.x3d files.
As I start relying more and more on JRuby, Clojure, GraalJS, Java, GraalPy,
this is becoming more important. I may have to take over X3DJSAIL
development. Me stylesheets?
For example, in the Java code, this appears:
*.setSkinCoord(new
Coordinate("SKINCOORD")*.setPoint(getSKINCOORD_4_120_point()))
.addSkin(new Group()
.addChild(new Shape("TrouserSkin")
.setAppearance(new
Appearance()
.setMaterial(new
Material().setDiffuseColor(0.0,0.0,1.0).setTransparency(0.5)))
.addComments(" # 0: sacrum (8) # 1: l_hip joint
(8) # 2: r_hip joint (8) # 3: l_thigh (48) # 4: l_knee joint (8) # 5:
l_calf (40) # 10: r_thigh (48) # 11: r_knee joint (8) # 12: r_calf (40) ")
.setGeometry(new
IndexedFaceSet().setCoordIndex(getIndexedFaceSet_6_123_coordIndex())
*.setCoord(new Coordinate().setUSE("SKINCOORD"))))*
Which appears like The DEF is before the USE. But in reality, searching
for SKINCOORD mentions in the Skin/BoxMan4_JavaExport.x3d reveals USE
before DEF.
<Coordinate USE='SKINCOORD'/>
<Coordinate USE='SKINCOORD'/>
<Coordinate USE='SKINCOORD'/>
<Coordinate USE='SKINCOORD'/>
<Coordinate USE='SKINCOORD'/>
<Coordinate DEF='SKINCOORD' point='
If it's too hard to reorder the skin/skinCoord fields, maybe start using
references instead of setUSE?
Maybe we should just remove any setDEF()/setUSE() in Java? That would be
interesting! I think we did something similar for ProtoInstances.
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250717/942be294/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BoxMan4.zip
Type: application/x-zip-compressed
Size: 51387 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250717/942be294/attachment-0001.bin>
More information about the x3d-public
mailing list