[x3d-public] Text.url or way to display source code in Castle Model Viewer (CastleScript)

Michalis Kamburelis michalis at castle-engine.io
Fri Apr 17 17:25:37 PDT 2026


1.  As for extending Castle Script to do this: 

    - I'm sorry, but no. I explained why in https://github.com/castle-engine/castle-model-viewer/issues/138 . 

    - Basically, Castle Script is not good enough to do this. It cannot express asynchronous downloading, and we don't want more ways to do synchronous downloading.

    - See also notes from "Note that CastleScript is a very simple scripting language" in https://castle-engine.io/castle_script docs :) I'm not really looking to extend CastleScript much more. It's simple, it will remain simple and with limited use-cases. There are much better scripting languages that eventually we will support in CGE :)

2.  I view "Text.url" as somewhat independent feature request.
    
    - From what I understand, the idea is that Text node could have a field "url" which allows to download the contents of indicated file, and display it (replacing "Text.string").
    
    - John's specific use-case would be to put there URL of the containing X3D file (to display the source code), but the general purpose is to put any long text inside "Text".
    
    - Hm, I'm not against it, it would be easy to implement.
    
    - At the same time, I don't see much use-case of it _for now_. People generally put rather small text in a "Text" node. But maybe introducing "Text.url" would actually enable more cool usage?
    
I'm looking at opinions of others about "Text.url". If others consider it useful enough, and it's going to be part of X3D spec, I would be happy to implement it. At the same time, I'm not really pushing for it -- as said, the use-case so far seems small. And from what I understand -- John already does the obvious solution that works now (keeping copy of source code in the relevant scene, to display it).

Regards,
Michalis

On Thursday, April 16th, 2026 at 23:10, John Carlson via x3d-public <x3d-public at web3d.org> wrote:

> I would like a Text.url field so that I can easily display downloaded source code in a Text node. I expect the Text.url field to change between different X3D encoded files.
> This should also work in Castle Model Viewer. It's easier to integrate with other browsers by not using Script at all.
> 
> A different node is also possible.
> 
> Discuss!
> 
> John



More information about the x3d-public mailing list