<div dir="ltr">Hi Emilio,<div><br></div><div>Please do not hesitate to ask any X3D or x3dom related questions here or over at the x3dom github repository when you have a chance to work on your new project as these are sure to crop up. Identifying and then resolving issues ultimately helps all of the community. The x3dom transparency problem was ultimately related to how the GPU was instructed on the lowest layer. There are still many other transparency issues related to how GPU rendering uses a simplistic model of light behaviour rather than ray tracing.<br></div><div><br></div><div>I do think a small notebook showing useful processing of the raw X3D export could be really helpful to Mathematica users. Sharing a downloadable version here or perhaps at Mathematica community forums, potentially from a dedicated github repo would seem most beneficial.</div><div><br></div><div>If you want to go one step further, submitting a 'polishX3D' or 'processX3D' function at the Mathematica Function Repository, could be very helpful to the community. Currently, there do not seem be X3D related functions available:</div><div><br></div><div><a href="https://resources.wolframcloud.com/FunctionRepository/search/?i=X3D">https://resources.wolframcloud.com/FunctionRepository/search/?i=X3D</a><br></div><div><br></div><div>I saw Mathematica notebooks can use python. If you know python, there is a good python library X3D.py authored by Don which can be very convenient in constructing well formed X3D documents.</div><div><br></div><div>Thanks again for sharing the beautiful 3d plots ! Andreas</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 28, 2023 at 10:30 AM Emilio Pisanty <<a href="mailto:emilio.pisanty@kcl.ac.uk">emilio.pisanty@kcl.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    Hi all,<br>
    First of all, thanks to Don for the kind words!<br>
    <br>
    Indeed, the models were created in Wolfram Mathematica, with some
    amount of post-processing for polish.<br>
    <br>
    Overall, Mathematica has grown into an extremely powerful tool for
    creating and manipulating 3D models in a broad range of scientific
    fields, for figures coming from both numerical data and analytical
    formulas.<br>
    <br>
    The X3D exporter from Mathematica is generally quite good! It has a
    few wrinkles where the primitives of X3D and Mathematica's
    Graphics3D don't align, but those can be worked around. The exporter
    does have some up-front bugs that mean that a small amount of
    post-processing is always required (IIRC a black background and
    including weird lights; implemented as cleanX3Dscene in the
    generator notebook deposited in Zenodo) but this is minimal.<br>
    <br>
    (If there is interest I can trim down the code there to create a
    minimal working example to export from a simple plot out to working
    X3D.)<br>
    <br>
    A similar example of generating X3D from Mathematica may be found at
    <a href="https://slalomincomplextime.github.io/" target="_blank">https://slalomincomplextime.github.io/</a>, with the generating
    notebooks at <a href="https://zenodo.org/record/46912" target="_blank">https://zenodo.org/record/46912</a>. Some of these are
    quite simple (direct export of a surface generated by Mathematica)
    while others are more involved (explicit creation of the X3D using
    Mathematica's XML package).<br>
    <br>
    In any case, huge thanks to the developers who continue to work on
    the x3dom library and who have brought the improvements that solve
    the transparency issues from ~3 years ago. I will embark on a
    similar project over the next year, which will hopefully give good
    opportunities to test the new behaviour in anger.<br>
    <br>
    Kind regards,<br>
    Emilio Pisanty<br>
    <br>
    <pre cols="72">-- 
Dr Emilio Pisanty
Royal Society University Research Fellow
Photonics & Nanotechnology Group
King's College London
Pronouns: he/him</pre>
    <br>
    <br>
    <div>On 28/07/2023 00:27, Andreas Plesch
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <table style="border:0px;display:table;width:100%;table-layout:fixed;float:none" width="100%" cellspacing="0" cellpadding="0" border="0" align="left">
        <tbody style="display:block">
          <tr>
            <td cellpadding="7px 2px 7px 2px" style="padding:7px 2px;background-color:rgb(166,166,166)" width="1px" valign="middle" bgcolor="#A6A6A6">
              <br>
            </td>
            <td cellpadding="7px 5px 7px 15px" color="#212121" style="width:100%;background-color:rgb(234,234,234);padding:7px 5px 7px 15px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;color:rgb(33,33,33);text-align:left" width="100%" valign="middle" bgcolor="#EAEAEA">
              <div>You don't often get email from
                <a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>. <a href="https://aka.ms/LearnAboutSenderIdentification" target="_blank">
                  Learn why this is important</a></div>
            </td>
            <td cellpadding="7px 5px 7px 5px" color="#212121" style="width:75px;background-color:rgb(234,234,234);padding:7px 5px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;color:rgb(33,33,33);text-align:left" width="75px" valign="middle" bgcolor="#EAEAEA" align="left">
              <br>
            </td>
          </tr>
        </tbody>
      </table>
      <div>
        <div dir="auto">
          <div>I was also curious and found that quite a bit of
            post-processing was done, inside a Mathematica notebook. The
            generator zenodo link in the meta data has the notebook. Xml
            made this quite possible.
            <div dir="auto"><br>
            </div>
            <div dir="auto">
              <div dir="auto">Andreas</div>
            </div>
            <br>
            <br>
            <div class="gmail_quote">
              <div dir="ltr" class="gmail_attr">On Thu, Jul 27, 2023,
                5:27 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>
                wrote:<br>
              </div>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                <div>
                  <div dir="auto">Looks like Wolfram Mathematica was
                    used to initially create the visualization?  Was
                    there post-processing done?  I’m interested in
                    Mathematica, but probably 20+ years ago it was
                    insufficient to do my plotting.  Ms. Gorjanc from
                    Zagreb’s work with Mathematica showed that such
                    things might be possible now.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">If someone wants to test Mathematica a
                    bit, try plotting:</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">r = A + B * cos (C * theta) * cos (D *
                    phi)</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">in spherical coordinates.  A,B,C and D
                    parameters vary over time.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">My work is shown here: <a href="https://coderextreme.net/" rel="noreferrer" target="_blank">
                      https://coderextreme.net/</a></div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">I have some visualizations where
                    people can vary the parameters on a web page, thanks
                    to X3DOM’s sliders, which i can’t access right now,
                    but is viewable as part of X3DJSONLD:  
                    <div><a href="https://coderextreme.net/X3DJSONLD/src/main/html/sphere.html" rel="noreferrer" target="_blank">https://coderextreme.net/X3DJSONLD/src/main/html/sphere.html</a></div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">My shaders for X3DOM are available
                      in X3DJSONLD under src/main/shaders (thanks to
                      Holger, Yvonne and Mick). I can’t achieve anything
                      near this speed in pure ECMAScript.    Generating
                      random numbers with a particle system might be
                      possible.</div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">Joe, the editor has been featured
                      before…I’m not sure why you haven’t seen it.</div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">If anyone wants to work on
                      multi-user visualization, please let me know.   I
                      have experience with
                      <a href="http://socket.io/" rel="noreferrer" target="_blank">socket.io</a>, but I
                      don’t have a server for communication right now. 
                      Christoph V?  Anyone?  Netlify?  SubZero?   I’ll
                      need to modify server-side code or just do
                      multicasting.   A simple multiuser forwarding
                      server is all that is needed.  I don’t want extra
                      server or any multicast setup.  Something as
                      simple as IRC I can work with, I think, but I
                      haven’t tried JavaScript IRC.  Perl and Java, yes.</div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">Thanks for listening.</div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">John </div>
                  </div>
                </div>
                <div>
                  <div><br>
                    <div class="gmail_quote">
                      <div dir="ltr" class="gmail_attr">On Thu, Jul 27,
                        2023 at 3:14 AM Brutzman, Donald (Don) (CIV)
                        <<a href="mailto:brutzman@nps.edu" rel="noreferrer" target="_blank">brutzman@nps.edu</a>>
                        wrote:<br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div lang="EN-US">
                          <div>
                            <p class="MsoNormal">Plotting in X3DOM is
                              achieving pretty amazing capabilities. 
                              Full-screen images illustrate how the
                              model is providing excellent interactive
                              visualizations.  Added here is link to a
                              hi-resolution image captured on a cell
                              phone, where the 3D plot is viewable and
                              manipulable even on a small screen.</p>
                            <p class="MsoNormal"> </p>
                            <ul style="margin-top:0in" type="disc">
                              <li style="margin-left:0in"><a href="https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/7716cf62d552a92504f704c6512b1738/raw/37eda2caeaa9a37ec712c93239485fc9385ce394/imaginary-harmonic-cutoff-figureOc_alpha.x3d" rel="noreferrer" target="_blank">https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/7716cf62d552a92504f704c6512b1738/raw/37eda2caeaa9a37ec712c93239485fc9385ce394/imaginary-harmonic-cutoff-figureOc_alpha.x3d</a></li>
                              <li style="margin-left:0in"><a href="https://user-images.githubusercontent.com/7712992/256463049-9fb079f8-95a7-4e07-875b-37483bd92de2.png" rel="noreferrer" target="_blank">https://user-images.githubusercontent.com/7712992/256463049-9fb079f8-95a7-4e07-875b-37483bd92de2.png</a></li>
                            </ul>
                            <p class="MsoNormal"> </p>
                            <p class="MsoNormal">Model metadata,
                              excerpted:</p>
                            <p class="MsoNormal"> </p>
                            <p class="MsoNormal" style="margin-left:0.5in"><X3D
                              profile='Immersive' version=’3.0’</p>
                            <p class="MsoNormal" style="margin-left:0.5in">    xmlns:xsd='<a href="http://www.w3.org/2001/XMLSchema-instance" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'</p>
                            <p class="MsoNormal" style="margin-left:0.5in">   
                              xsd:noNamespaceSchemaLocation='<a href="http://www.web3d.org/specifications/x3d-3.0.xsd" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/x3d-3.0.xsd</a>'></p>
                            <p class="MsoNormal" style="margin-left:0.5in"><head></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='creator' content='Emilio
                              Pisanty' /></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='created' content='Thu 26
                              Mar 2020 19:16:33' /></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='title'
                              content='imaginary-harmonic-cutoff-figureOc_alpha.x3d'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='description' content='3D
                              Fig. 1c in Pisanty et al, 2020'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='modifier' content='Andreas
                              Plesch'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='modified' content='26 July
                              2023'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reason'
                              content='transparency'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reference' content='<a href="https://imaginary-harmonic-cutoff.github.io/" rel="noreferrer" target="_blank">https://imaginary-harmonic-cutoff.github.io</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reference' content='<a href="https://doi.org/10.5281/zenodo.3758483" rel="noreferrer" target="_blank">https://doi.org/10.5281/zenodo.3758483</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reference' content='<a href="https://doi.org/10.1088/2515-7647/ab8f1e" rel="noreferrer" target="_blank">https://doi.org/10.1088/2515-7647/ab8f1e</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reference' content='<a href="https://arxiv.org/abs/2003.00277v2" rel="noreferrer" target="_blank">https://arxiv.org/abs/2003.00277v2</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='reference' content='The
                              imaginary part of the high-harmonic
                              cutoff. E. Pisanty, M.F. Ciappina and M.
                              Lewenstein. J. Phys. Photonics 2, 034013
                              (2020), arXiv:2003.00277.'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='rights' content='© Emilio
                              Pisanty, 2020'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='subject'
                              content='Photonics: The imaginary part of
                              the high-harmonic cutoff'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='identifier' content='<a href="https://gist.github.com/andreasplesch/7716cf62d552a92504f704c6512b1738#file-imaginary-harmonic-cutoff-figureoc_alpha-x3d" rel="noreferrer" target="_blank">https://gist.github.com/andreasplesch/7716cf62d552a92504f704c6512b1738#file-imaginary-harmonic-cutoff-figureoc_alpha-x3d</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='generator' content='Wolfram
                              Mathematica
                              <a href="https://www.wolfram.com/mathematica" rel="noreferrer" target="_blank">https://www.wolfram.com/mathematica</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='generator' content='<a href="https://doi.org/10.5281/zenodo.3692562" rel="noreferrer" target="_blank">https://doi.org/10.5281/zenodo.3692562</a>'/></p>
                            <p class="MsoNormal" style="margin-left:1in"> 
                              <meta name='license' content='CC BY-SA
                              4.0
                              <a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="noreferrer" target="_blank">
https://creativecommons.org/licenses/by-sa/4.0</a>'/></p>
                            <p class="MsoNormal" style="margin-left:0.5in"></head></p>
                            <p class="MsoNormal"> </p>
                            <p class="MsoNormal">from thread</p>
                            <ul style="margin-top:0in" type="disc">
                              <li style="margin-left:0in">Patchy
                                appearance of semi-transparent objects
                                where they lie behind themselves</li>
                              <li style="margin-left:0in"><a href="https://github.com/x3dom/x3dom/issues/1053" rel="noreferrer" target="_blank">https://github.com/x3dom/x3dom/issues/1053</a></li>
                            </ul>
                            <p class="MsoNormal"> </p>
                            <p class="MsoNormal">Totally impressive,
                              feels like multiple major steps forward. 
                              Congratulations and thanks to the model
                              authors and x3dom team!</p>
                            <p class="MsoNormal"><span> </span></p>
                            <p class="MsoNormal"><span>all the best, Don</span></p>
                            <p class="MsoNormal"><span>-- <u>
                                </u></span></p>
                            <p class="MsoNormal"><span>Don Brutzman  Naval
                                Postgraduate School, Code USW/Br       
                                <a href="mailto:brutzman@nps.edu" rel="noreferrer" target="_blank">
                                  brutzman@nps.edu</a></span></p>
                            <p class="MsoNormal"><span>Watkins 270,  MOVES
                                Institute, Monterey CA 93943-5000 USA   
                                +1.831.656.2149</span></p>
                            <p class="MsoNormal"><span>X3D graphics, virtual worlds,
                                navy robotics
                                <a href="https://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">
                                  https://faculty.nps.edu/brutzman</a></span></p>
                            <p class="MsoNormal"> </p>
                          </div>
                        </div>
                        _______________________________________________<br>
                        x3d-public mailing list<br>
                        <a href="mailto:x3d-public@web3d.org" rel="noreferrer" target="_blank">x3d-public@web3d.org</a><br>
                        <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
                      </blockquote>
                    </div>
                  </div>
                </div>
              </blockquote>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div>