[x3d-public] got Three.js and X3D? npm package

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Tue Feb 21 15:23:58 PST 2023


Holger this looks super.  Thanks for sharing an npm package.

 

Some further alignments appear potentially beneficial.

 

Please note that when adjusting whitespace and XML formatting (at least), we have rules for canonicalization (C14N).  Of note is that consistent whitespace is helpful for version-control diffing and security (authentication/encryption), also defined formally as follows.

 

*	Extensible 3D (X3D) encodings, Part 3: Compressed binary encoding, clause 4 Concepts 4.2.3 X3D canonical form
*	https://www.web3d.org/documents/specifications/19776-3/V3.3/Part03/concepts.html#X3DCanonicalForm

 

These rules are followed by X3DJSAIL (Java), X3DPSAIL (x3d.py Python), build scripts for all Web3D examples, and X3D-Edit C14N jar.

 

These tools don’t reduce float/double precision, that is an interesting/tricky possibility to follow.

 

Also please note that there is an X3dTidy stylesheet already so named, for XML encoding, which cleans up whitespace (I hope consistently) but also performs a number of possible corrections (similar to HTML Tidy).

 

*	X3D Tidy for Scene Cleanup, Corrections and Modifications
*	X3D Tidy is an XSLT stylesheet that checks for simple authoring difficulties in X3D scenes and fixes them.
*	https://www.web3d.org/x3d/stylesheets/X3dTidy.html

 

Hopefully we continue making excellent progress with consistency (and clear naming) for all these useful tools.  A powerful ecosystem can emerge.

 

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: Holger Seelig <holger.seelig at yahoo.de> 
Sent: Tuesday, February 21, 2023 4:17 AM
To: Michalis Kamburelis <michalis.kambi at gmail.com>
Cc: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D <x3d-public at web3d.org>
Subject: Re: [x3d-public] got Three.js and X3D?

 

There is no online converter (yet), but there is a Node npx command 'x3d-tidy‘ which uses X_ITE underneath. 

 

https://www.npmjs.com/package/x3d-tidy <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fx3d-tidy&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370069363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3rBPWOeXUU84mo1ciKfpcS61XK7SxP%2BC1EznOHHqZQ8%3D&reserved=0> 

 

With this tool it is possible to convert, compress and minimize or beautify X3D and all other supported formats. 

 

An online tool is a nice idea. I will see what I can do in the next time.

 

Best regards,

Holger





Am 21.02.2023 um 13:00 schrieb Michalis Kamburelis <michalis.kambi at gmail.com <mailto:michalis.kambi at gmail.com> >:

 

@Holger: Fantastic news!

 

Do you maybe have (or plan to have) a simple "online converter" using X_ITE underneath, similar to e.g. https://castle-engine.io/convert.php <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcastle-engine.io%2Fconvert.php&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370069363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nHTOANWDJO9YsPuXY5X07XFPNmzRrOwP6IV7B1JYVIg%3D&reserved=0>  ? Easy to use for people who may not want to use X_ITE for rendering on their webpage, but just want to convert from https://create3000.github.io/x_ite/#supported-file-formats <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcreate3000.github.io%2Fx_ite%2F%23supported-file-formats&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370069363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hfUQNxqfuFA9jdHO0b9jm1gTUhsNHiC%2F8qAO7IpiGdM%3D&reserved=0>  -> to X3D XML?

 

My personal reason for asking: People sometimes ask about using SVG with Castle Game Engine, which we don't support (yet). Of course one can easily convert SVG -> PNG... but with X_ITE, I understand you convert SVG -> X3D nodes with geometry, so it remains 100% scalable. I would love to recommend people "if you want to use SVG in CGE, as a full scalable geometry, go ahead and use X_ITE converter to X3D on xxx".

 

Regards,

Michalis

 

wt., 21 lut 2023 o 11:27 Holger Seelig <holger.seelig at yahoo.de <mailto:holger.seelig at yahoo.de> > napisał(a):

I would like to announce that X_ITE now also has support for .glTF, .glb, .obj, .stl, and .svg. 😀 

 

https://create3000.github.io/x_ite/#supported-file-formats <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcreate3000.github.io%2Fx_ite%2F%23supported-file-formats&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370069363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hfUQNxqfuFA9jdHO0b9jm1gTUhsNHiC%2F8qAO7IpiGdM%3D&reserved=0>  

 

As well as importing files, X_ITE can output XML, VRML and also JSON now by implementing toXMLString, toJSONString and toVRMLString.

 

https://create3000.github.io/x_ite/reference/scene-services#string-tovrmlstring-options <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcreate3000.github.io%2Fx_ite%2Freference%2Fscene-services%23string-tovrmlstring-options&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0lnuG8trOajtgmmV%2Bh69eJTr6kqsLPkPdLu0qiDTDC8%3D&reserved=0> 

 

Best regards,

Holger

 





Am 21.02.2023 um 07:39 schrieb Brutzman, Donald (Don) (CIV) <brutzman at nps.edu <mailto:brutzman at nps.edu> >:

 

Thanks John, your suggestions pretty closely match mine.  Workflow seems external to X3D4 pathways, typically performed offline.  It seems sensible to avoid intermediate-format conversions if possible, since that offers more potential for “lost in translation” conversion problems.

 

Please note that X3D4 specification only supports glTF loading and rendering, not .obj files.  Specification excerpts follow:

 

 

*	X3D4 Architecture, Networking component, 9.4.2 Inline
*	https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-DIS/Part01/components/networking.html#Inline
*	The run-time system can support any number of 3D model resource types as long as those follow the abstract model definition (see 2.[RFC2077]), provide a registered content type ( e.g., model/x3d-xml, model/gltf-bin, model/stl, etc.), and can be determined with some form of content negotiation (see 2.[RFC2616]). The run-time system must support at least one X3D type ( e.g., model/x3d-xml) but can also support and negotiate any number of X3D encodings and (optionally) non-X3D representation formats. Support for loading glTF assets (see 2.[GLTF]) also requires support for Shape component level 2 and Lighting component level 4.

 

*	X3D4 Architecture, Networking component, Table 9.3 — Networking component support levels
*	https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-DIS/Part01/components/networking.html#t-supportLevels
*	Level 4, prerequisites Core 1 and Grouping 1, Nodes/Features and Support:

 


Model support

Support for glTF models in Inline nodes, in .gltf (model/gltf+json) and .glb (model/gltf-binary) formats.

Requires support for Shape component level 2 and Lighting component level 3.

Minimum required glTF support:

*	transformation hierarchy,
*	meshes,
*	physical materials,
*	loading of external binary data referenced from .gltf files ( e.g., for vertex coordinates).

 

*	X3D4 Architecture, Clause 2 Normative references
*	https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-DIS/Part01/references.html#GLTF
*	GL Transmission Format (glTF) Specification, The Khronos Group, Version 2.0, 2021.
*	https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKhronosGroup%2FglTF%2Ftree%2Fmaster%2Fspecification%2F2.0&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EnxnWSnyyNLpGG%2Ffqleb%2BHLjUzYGEG1ryAM35%2FUfte8%3D&reserved=0> 

 

 

Careful scrutiny of the prose above should reveal that we do not forbid browser support for other formats.  A premier example browser which not only loads and displays numerous formats but typically can also save back out as X3D or VRML:

 

*	Castle Game Engine, view3dscene 4.2.0
*	view3dscene is a viewer for many 3D model formats: glTF, X3D, VRML, Collada, 3DS, MD3, Wavefront OBJ, STL and (2D) Spine JSON and sprite sheets (in CGE, Cocos2d, Starling XML formats).
*	4.2. Converting to X3D
*	https://castle-engine.io/view3dscene.php#section_converting <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcastle-engine.io%2Fview3dscene.php%23section_converting&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LmM75LEZxSEKVDL4g6LhkvZRoDhLOfOmUUpgeHm2Bg0%3D&reserved=0> 

 

Our master list of conversion and import/export tools follow.  Additions and updates always welcome, anything else out there that anyone wants to recommend?

 

*	X3D Resources: Conversions and Translation Tools
*	https://www.web3d.org/x3d/content/examples/X3dResources.html#Conversions

 

*	X3D Resources: Export and Import by Applications
*	https://www.web3d.org/x3d/content/examples/X3dResources.html#Export

 

Have fun with Castle Game Engine view3dscene!  8)

 

all the best, Don

-- 

Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu <mailto: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 <http://faculty.nps.edu/brutzman> 

 

From: John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com> > 
Sent: Monday, February 20, 2023 6:01 PM
To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu <mailto:brutzman at nps.edu> >
Cc: X3D Public Mailing List (x3d-public at web3d.org <mailto:x3d-public at web3d.org> ) <x3d-public at web3d.org <mailto:x3d-public at web3d.org> >
Subject: Re: [x3d-public] got Three.js and X3D?

 

My tendency would be to go from X3D to glTF or COLLADA to glTF and then load glTF into three.js.  Also x3d to OBJ looks like a thing with aopt.

 

I believe both OBJ and glTF are supported by X3d4.

 

OBJ is native to three.js

 

If you find a tessellation library in all of this, that would good to know.

 

John

 

On Mon, Feb 20, 2023 at 5:47 PM Brutzman, Donald (Don) (CIV) <brutzman at nps.edu <mailto:brutzman at nps.edu> > wrote:

Three.js is an independently developed Javascript library.  Wondering about relationship (if any) for X3D use.  Some X3D folks have used it in the past but am not seeing any common ground at

*     https://threejs.org/docs/#manual/en/introduction/Loading-3D-models <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fthreejs.org%2Fdocs%2F%23manual%2Fen%2Fintroduction%2FLoading-3D-models&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=t6ijtpJdSZrCe4o6qClMuZ%2BR6dPo8V4h0HjKbfGPFro%3D&reserved=0> 

Searching a little more, found some older posts:

*	https://github.com/dividab/three-x3d-loader <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdividab%2Fthree-x3d-loader&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=16MbiNCHLXZZjCx9iA5qJsBLQkBypC3gMxEnU5ROCYg%3D&reserved=0> 

*	https://stackoverflow.com/questions/20810737/importing-x3d-files-into-three-js <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F20810737%2Fimporting-x3d-files-into-three-js&data=05%7C01%7Cbrutzman%40nps.edu%7C7d106669ad7c4343ff8c08db14059079%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638125786370225031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=tLdSnewXRJpRsDQ6Z9h5FISxtuh6XvF3UoJu7L8o3rA%3D&reserved=0> 

 Apparent overlap: capability for loading glTF models.

 Just curious, thanks for all opinions.  If there is something worth including on X3D Resources, will add it.

all the best, Don

-- 

Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu <mailto: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 <http://faculty.nps.edu/brutzman> 

 

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org <mailto:x3d-public at web3d.org> 
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

_______________________________________________
x3d-public mailing list
 <mailto:x3d-public at web3d.org> x3d-public at web3d.org
 <http://web3d.org/mailman/listinfo/x3d-public_web3d.org> http://web3d.org/mailman/listinfo/x3d-public_web3d.org

 

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org <mailto:x3d-public at web3d.org> 
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230221/515669f4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5353 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230221/515669f4/attachment-0001.p7s>


More information about the x3d-public mailing list