[x3d-public] x3d.py works in web browser with brython. No Jupyter needed AFAIK!

John Carlson yottzumm at gmail.com
Thu Dec 22 01:06:03 PST 2022


https://github.com/coderextreme/X3DJSONLD/tree/master/hello

We should now be able to get python x3d.py X3DPSAIL working on web again.

The solution is brython, a python package, implementation of python in JS.

Uses, X3DOM, may try for an X_ITE version.

Hint:  Use a local version of brython, not CDN.

If someone wants to see the results, I can zoom.

John

On Wed, Dec 21, 2022 at 10:42 PM John Carlson <yottzumm at gmail.com> wrote:

> I'm going to swap back to brython instead of nbviewer or binder. Do you
> have any experience with brython, Vince?  I'll contact my Germany brython
> contact if he's available now.
>
> On Wed, Dec 21, 2022 at 3:27 PM Vincent Marchetti <vmarchetti at kshell.com>
> wrote:
>
>> I forgot to mention that the rendering of an .ipynb file on the github
>> page can garble the markup.
>>
>> A more reliable way to see the notebook as a static rendering is to use
>> the nbviewer page:
>>
>>
>> https://nbviewer.org/github/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb
>>
>> to see this HelloWorld style example of putting an X3D scene in a Jupyter
>> notebook
>>
>> Vince Marchetti
>>
>>
>> > On Dec 21, 2022, at 4:16 PM, Vincent Marchetti <vmarchetti at kshell.com>
>> wrote:
>> >
>> > 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.
>> >
>> > 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
>> >
>> >
>> https://github.com/vincentmarchetti/web3d2021_jupyter_tutorial/blob/main/HelloWorld.ipynb
>> >
>> > 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.
>> >
>> > I did note two problems in fully rendering the HelloWorld scene,
>> pertaining to loading the image texture from the web3d.org site
>> > 1. X3DOM only tries the first URL in the ImageTexture url field
>> > 2. Even if the web3d.org url is put first, the web3d.org server is not
>> configured to support the strict CORS protocol. As a result, the Firefox
>> brower will retrieve the the image from web3d.org, but will not allow
>> the x3dom code to see that data.
>> >
>> > The notebook referenced above from github will render the earth as a
>> sphere and show the text in the X3D scene.
>> >
>> > Vince Marchetti
>> >
>> >
>> >
>> >
>> >
>> >> On Dec 21, 2022, at 5:08 AM, John Carlson <yottzumm at gmail.com> wrote:
>> >>
>> >>
>> >> <HelloWorld.ipynb>_______________________________________________
>> >> x3d-public mailing list
>> >> x3d-public at web3d.org
>> >> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>> >
>> >
>> > _______________________________________________
>> > x3d-public mailing list
>> > 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/20221222/ff1f06c9/attachment.html>


More information about the x3d-public mailing list