Hacker News new | past | comments | ask | show | jobs | submit login

I am curious how you intend to get ThreeJS (or similar) working without a canvas DOM element?

Isn’t that a lot of work? Or is there an obvious way to hook it up that I’m missing?




Three.js should load and run as long as its usage of window, document, etc works as it expects. So the plan is to have a small loader that prepares the environment that Three.js expects before loading it.

This has already been done for Processing/p5.js:

https://windowjs.org/about/processing

After the initial load, all of the p5.js APIs make CanvasRendering2DContext calls, which Window.js implements natively.

Almost all of the p5.js examples work with this approach, except those that use DOM elements like buttons and sliders. Those elements could also be faked, with some patience :-)

I think it's pretty cool that p5.js scripts can run on a desktop window this way, outside of the browser!

As an aside, I also originally intended to implement an HTML renderer on something like Window.js, and make a "browser from scratch" based on it. Maybe for another day...


Neat! Will have a deeper look and see what you mean about the processing support!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: