<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:"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;}
.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;}
--></style></head><body lang=EN-US link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I’ll just let this ride with you thinking that if I type one number you can go ahead and change it to something else just because it is too much work to keep it the same. I don’t want your runtime numbers, I want to see it run with my authortime numbers. I will decide what resolution is right when I  publish my user code. Maybe that is why I am stuck in Notepad, but really, any gui is not going to autocorrect, even something like x3dedit. </p><p class=MsoNormal>True it is bound to change when you are exporting your runtime code to do a transcoding like you did for classic to xml, by loading the thing, then export with no regard to input. To me, that mangled the thing almost beyond recognition and puffed it up by greatly. Process needs improvement, with more reference to the input content, Thank You. </p><p class=MsoNormal>True what really happens under the covers may be off by rounding float please just recall that human-readable text is the final test of whether it is X3D or a blob. As a browser maker, when you choose a solution it should be on the side of author convenience and readability and validation rather than browser implementer idealism, convenience, or reduced workload. </p><p class=MsoNormal>Thanks Again for your progress with your browser. </p><p class=MsoNormal>Joe</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>From: </b><a href="mailto:michalis.kambi@gmail.com">Michalis Kamburelis</a><br><b>Sent: </b>Saturday, February 11, 2023 4:47 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:joedwil@earthlink.net">Joseph D Williams</a>; <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><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It is true that on output -- we may produce more digits than we saw in</p><p class=MsoNormal>input, because internally the numbers get converted into floats, and</p><p class=MsoNormal>floats cannot represent all the numbers precisely.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That is, putting</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   0.0001</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>into float (4-byte IEEE-754 single) results in a number equal</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  0.00009999...</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When writing, we don't have anymore the information whether you</p><p class=MsoNormal>actually specified literally  "0.0001" or "0.00009999..".</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That said, solution with storing a text representation of every input</p><p class=MsoNormal>float  (including text representation of every array of floats) is</p><p class=MsoNormal>just not feasible. That's a lot of information, and additional</p><p class=MsoNormal>maintenance about what to do when these numbers change (what if code</p><p class=MsoNormal>manipulates those numbers? including X3D scripts / SAI?).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>No X3D browser, no 3D software in general (any game engine, 3D viewer</p><p class=MsoNormal>for any format) that allows to render and manipulate the 3D content,</p><p class=MsoNormal>is storing the original numbers in text form, from what I know. That</p><p class=MsoNormal>would be just a lot of extra work. The software in practice has a</p><p class=MsoNormal>choice of outputting the numbers with max precision (yes, it means you</p><p class=MsoNormal>see more digits than on input) or making an assumption that some</p><p class=MsoNormal>digits are not important for user (and then, users who specify very</p><p class=MsoNormal>small numbers, and count on their precision, are at a loss).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Unless you have a specific software that only does conversion, never</p><p class=MsoNormal>manipulation, then maybe can afford to just store numbers as text.</p><p class=MsoNormal>Alas, that is not CGE/view3dscene (and I claim that we're in same spot</p><p class=MsoNormal>as all other X3D browsers or 3D viewers; if they output numbers in</p><p class=MsoNormal>decimal, doing float->text conversion, they have to assume some</p><p class=MsoNormal>precision that may not match the input).</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>sob., 11 lut 2023 o 22:26 John Carlson <yottzumm@gmail.com> napisał(a):</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> We should check all of my synthesis tools in X3DJSONLD, i know some of them extend the precision.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> The best thing to do is create a small file which shows the problem, and then run it through our processes.  I’ll do that when I get home.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> If you find a bug, please report:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> https://github.com/coderextreme/X3DJSONLD/issues</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Just look at current data files:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/data/*</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/*/net/*/data/*</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> I’m going through a major revision, bringing the  product up to ES6.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Thanks!</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 Sat, Feb 11, 2023 at 3:02 PM Joseph D Williams <joedwil@earthlink.net> wrote:</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> The option is to present the text in text form. What you do inside should not bother my right to read and interact with the text. And please don’t give me more resolution than I request in my user code. Don’t autocorrect how many digits I specify. Hanim doesn’t need anymore than 4 anywhere. Think of how somebody looks  at the code and sees these endless cols of 10 of more digits, not even consistent and not readable  anymore.</p><p class=MsoNormal>>><o:p> </o:p></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><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> From: John Carlson</p><p class=MsoNormal>>> Sent: Friday, February 10, 2023 11:20 AM</p><p class=MsoNormal>>> To: Michalis Kamburelis</p><p class=MsoNormal>>> Cc: X3D Public Mailing List (x3d-public@web3d.org)</p><p class=MsoNormal>>> Subject: Re: [x3d-public] Wishlist for view3dscene</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>>>  There should be an option to convert binary vertex and index data to ASCII, if only during authoring.</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>>> Remember that Joe/designers like to tweak.</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>>> I find that converting JSON through JavaScript massively increases precision, but i haven’t looked at why yet.  Maybe JSON/JavaScript numerical libraries should be responsible for keeping precise, accurate numbers, perhaps by storing alternate encodings for I/O and computation.</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>>> One can always convert to EXI and back, to serve ASCII purposes.</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>>> John</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>>> On Fri, Feb 10, 2023 at 12:36 PM Michalis Kamburelis <michalis.kambi@gmail.com> wrote:</p><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>>> ></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>>> ></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>>> ></p><p class=MsoNormal>>> > I don’t know if there’s a JavaScript or Python solution for this.</p><p class=MsoNormal>>> ></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>>> ></p><p class=MsoNormal>>> > John</p><p class=MsoNormal>>> ></p><p class=MsoNormal>>> > On Fri, Feb 10, 2023 at 7:13 AM Michalis Kamburelis <michalis.kambi@gmail.com> wrote:</p><p class=MsoNormal>>> >></p><p class=MsoNormal>>> >> Thanks, and sorry for a delay in answering!</p><p class=MsoNormal>>> >></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>>> >></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>>> >></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>>> >></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>>> >></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>>> >></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>>> >></p><p class=MsoNormal>>> >> Regards,</p><p class=MsoNormal>>> >> Michalis</p><p class=MsoNormal>>> >></p><p class=MsoNormal>>> >></p><p class=MsoNormal>>> >></p><p class=MsoNormal>>> >></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>>> >></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>>><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>