<div dir="ltr"><div dir="ltr">Note that this binder no longer views any X3D rendering?<div><br></div><div><a href="https://nbviewer.org/github/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb">https://nbviewer.org/github/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb</a><br></div><div><br></div><div>Something's up.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 19, 2023 at 7:20 AM John Carlson <<a href="mailto:yottzumm@gmail.com">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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Vincent, I am trying to duplicate this with Mojo Python in Mojo Playground JupyterHub. Sometimes the packages fail to import. Here's my python code:</div><div dir="ltr"><br></div><div dir="ltr"><br><div><div>from IPython import display, HTML</div><div>import x3d</div><div>from x3d import X3D</div><div>from x3d import metaDiagnostics</div></div><div><br></div><div># snip, add newModel to context instead of this comment.</div><div><br></div><div><div>str = newModel.Scene.HTML5()</div><div><br></div><div>x3dnode = """</div><div><script type='text/javascript' charset="UTF-8" src='<a href="https://x3dom.org/release/x3dom-full.debug.js" target="_blank">https://x3dom.org/release/x3dom-full.debug.js</a>'> </script> </div><div><link rel='stylesheet' type='text/css' href='<a href="https://x3dom.org/release/x3dom.css" target="_blank">https://x3dom.org/release/x3dom.css</a>'></link> </div><div><style></div><div> x3d {</div><div> width:720px;</div><div> height:720px;</div><div> border:2px solid black;</div><div>}</div><div></style><x3d>"""+str+"""</div><div></x3d></div><div><script></div><div>window.x3dom.reload()</div><div></script>"""</div><div><br></div><div>HTML(x3dnode)</div></div><div><br></div><div><br></div><div># not sure what I'm doing wrong???</div><div><br></div><div>Could this console problem mean something?</div><div><br></div><div><div>Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm did not respond in time</div><div>_loadFromKernel @ 150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1</div></div><div><br></div><div>Search for Mojo Playground in google, if you are already enrolled.</div><div><br></div><div>Thanks!</div><div><br></div><div>John</div><div><br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 21, 2022 at 3:16 PM Vincent Marchetti <<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.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">A problem with the Jupyter notebook attached in this email was that the entire XML document, including the <xml...> declaration, was inserted into the <x3d> node for X3DOM to interpret, and that failed.<br>
<br>
There seem to be as many ways of inserting an <x3d> node for X3DOM into an notebook as there are authors, but the method I use is illustrated at<br>
<br>
<a href="https://github.com/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb" rel="noreferrer" target="_blank">https://github.com/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb</a> <br>
<br>
which is an attempt at illustrating the intent of John's notebook, to prepare the HelloWorld scene using the X3D python module, and then to render it in the notebook.<br>
<br>
I did note two problems in fully rendering the HelloWorld scene, pertaining to loading the image texture from the <a href="http://web3d.org" rel="noreferrer" target="_blank">web3d.org</a> site<br>
1. X3DOM only tries the first URL in the ImageTexture url field<br>
2. Even if the <a href="http://web3d.org" rel="noreferrer" target="_blank">web3d.org</a> url is put first, the <a href="http://web3d.org" rel="noreferrer" target="_blank">web3d.org</a> server is not configured to support the strict CORS protocol. As a result, the Firefox brower will retrieve the the image from <a href="http://web3d.org" rel="noreferrer" target="_blank">web3d.org</a>, but will not allow the x3dom code to see that data.<br>
<br>
The notebook referenced above from github will render the earth as a sphere and show the text in the X3D scene.<br>
<br>
Vince Marchetti<br>
<br>
<br>
<br>
<br>
<br>
> On Dec 21, 2022, at 5:08 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
> <br>
> <br>
> <HelloWorld.ipynb>_______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
<br>
</blockquote></div>
</blockquote></div>