<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:443381765;
        mso-list-type:hybrid;
        mso-list-template-ids:1000924682 -1 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Otherwise you will always discover use-cases<o:p></o:p></li></ul><p class=MsoNormal>when you loose some digits</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>show one.  I don’t care what you do under the  covers, justdon’t change my code for this reason because it ain’t there. </p><p class=MsoNormal>Joe</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:michalis.kambi@gmail.com">Michalis Kamburelis</a><br><b>Sent: </b>Friday, February 10, 2023 10:37 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Public Mailing List (x3d-public@web3d.org)</a><br><b>Subject: </b>Re: [x3d-public] Wishlist for view3dscene</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We use optional scientific notation (with exponent) when writing</p><p class=MsoNormal>numbers in CGE/view3dscene. To be precise, we use a formatting option</p><p class=MsoNormal>that outputs either a scientific or decimal notation, whichever is</p><p class=MsoNormal>shorter. The scientific notation is not that much shorter to win</p><p class=MsoNormal>usually.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As for round-trips: you must have maximum precision to have reliable</p><p class=MsoNormal>round-trips, I believe :) Otherwise you will always discover use-cases</p><p class=MsoNormal>when you loose some digits, and they will be important for someone.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>glTF does what is obvious, and I'd say X3D should follow, this is</p><p class=MsoNormal>something I'd like to work on for X3D 4.1 (</p><p class=MsoNormal>https://github.com/michaliskambi/x3d-tests/wiki/Binary-meshes ).</p><p class=MsoNormal>Namely, the floats in per-vertex data are always stored as binary.</p><p class=MsoNormal>Only the floats like material parameters are stored as text in JSON.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>X3D binary encoding is one solution here, but it is not wide-spread,</p><p class=MsoNormal>e.g. I hope zero hope that Blender exporter would output X3D binary</p><p class=MsoNormal>encoding someday (there's too many other critical issues in Blender</p><p class=MsoNormal>X3D exporter). And X3D binary encoding doesn't make data interleaved,</p><p class=MsoNormal>so it doesn't solve the issue of effectively delivering it to GPU.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>"keep numbers and arrays as strings" -- no, this really wouldn't help</p><p class=MsoNormal>with anything. The X3D browser has to parse the text to numbers at</p><p class=MsoNormal>some point, to process the points, upload them to GPU etc. Right now</p><p class=MsoNormal>the bottleneck of reading real-life X3D is always, in my experience,</p><p class=MsoNormal>"your code effectively has to make million of text-to-float</p><p class=MsoNormal>conversions". I believe this is a bottleneck regardless of the</p><p class=MsoNormal>programming language, 1000 * 1000 calls to text-to-float is always</p><p class=MsoNormal>going to be much slower than reading binary data (where you say "this</p><p class=MsoNormal>is my pointer to 1000 * 1000 * 4 bytes, just copy there the contents</p><p class=MsoNormal>of this file").</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,</p><p class=MsoNormal>Michalis</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>pt., 10 lut 2023 o 18:57 John Carlson <yottzumm@gmail.com> napisał(a):</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Not sure how feasible this is with Pascal, etc.   Perhaps consider scientific or engineering notation with exponents.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> In most cases i see, extending precision significantly increases file size, and makes it harder to do round trips.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> I don’t know if there’s a JavaScript or Python solution for this.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Perhaps we should not implement number types in our synthesized programs, and keep numbers and arrays as strings.   Then we have to ask what is done in glTF.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> John</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> On Fri, Feb 10, 2023 at 7:13 AM Michalis Kamburelis <michalis.kambi@gmail.com> wrote:</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Thanks, and sorry for a delay in answering!</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> The "description" field has been added to texture nodes and few more,</p><p class=MsoNormal>>> as you can see in another thread on x3d-public :)</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> As for digits precision when saving: it's not so easy, in general it's</p><p class=MsoNormal>>> (one of) the problems that come from X3D using text representation for</p><p class=MsoNormal>>> floats in per-vertex data. Namely, if we cut the saved numbers to 4</p><p class=MsoNormal>>> decimal places, I'm 90% sure that I will get a valid bugreport from</p><p class=MsoNormal>>> someone:</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> """</p><p class=MsoNormal>>> Hey, my stuff no longer works! My models (in glTF, X3D, whatever) have</p><p class=MsoNormal>>> vertexes at coordinates like Z = 0.00001, 0.00002, 0.00003. And now,</p><p class=MsoNormal>>> after processing and saving to X3D using your tools, they are all</p><p class=MsoNormal>>> equal zero, resulting in bugs (things start to fight in Z buffer).</p><p class=MsoNormal>>> """</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Surely we could add a configuration option for it, but it feels</p><p class=MsoNormal>>> counter-productive, when my recommendation to everyone would be still</p><p class=MsoNormal>>> "use the maximum precision, to be safe". I would add a feature that I</p><p class=MsoNormal>>> explicitly say should not be used.</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> In the end, the longer text representation for numbers only hurts the</p><p class=MsoNormal>>> file size. And I don't believe we can really fix it by outputting less</p><p class=MsoNormal>>> digits. The right solution is storing per-vertex data in a binary</p><p class=MsoNormal>>> blob, when each float is binary 4 bytes, so it's</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> - efficient storage</p><p class=MsoNormal>>> - efficient reading by X3D implementation to a "float[] array", no</p><p class=MsoNormal>>> need for text parsing.</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Regards,</p><p class=MsoNormal>>> Michalis</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> śr., 28 gru 2022 o 21:00 Brutzman, Donald (Don) (CIV)</p><p class=MsoNormal>>> <brutzman@nps.edu> napisał(a):</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Hi Michalis. Joe and I are really enjoying the many excellent features of view3dscene.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Here are some suggested refinements and improvements.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > View3dscene converter: round off significant digits, rather than 10+ decimal places.  (For example, suggested values in HAnim spec go to 4 decimal places.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > View3dscene: note that we have added ‘description’ field to many nodes in X3D4, including ImageTexture.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > 1 warnings:</p><p class=MsoNormal>>> > X3D: Unknown X3D field name (unhandled X3D XML attribute) "description" in node "ImageTexture"</p><p class=MsoNormal>>> > Scene URL: "C:\x3d-code\www.web3d.org\x3d\content\examples\HumanoidAnimation\Skin\JoeSkeletonSkinSiteSaluteWalk.x3d".</p><p class=MsoNormal>>> > Use "File->View Warnings" menu to view these warnings again.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Coming soon: import test of three models in HAnim Motion specification.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > https://www.web3d.org/documents/specifications/19774/V2.0/MotionDataAnimation/MotionDataAnimation.html</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Again thanks for great work.</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > all the best, Don</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > --</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman@nps.edu</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > X3D graphics, virtual worlds, Navy robotics https:// faculty.nps.edu/brutzman</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> ></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> _______________________________________________</p><p class=MsoNormal>>> x3d-public mailing list</p><p class=MsoNormal>>> x3d-public@web3d.org</p><p class=MsoNormal>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>_______________________________________________</p><p class=MsoNormal>x3d-public mailing list</p><p class=MsoNormal>x3d-public@web3d.org</p><p class=MsoNormal>http://web3d.org/mailman/listinfo/x3d-public_web3d.org</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>