Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBJS in 3D
#1
For some time I've been looking at different ways to leverage the WebGL capabilities of the browser in QBJS.  There have been a number of requests to implement _MapTriangle and provide access to GL shaders, etc.  Well, while searching for some lower-level JS libraries that might make interacting with WebGL a bit nicer, I ran across three.js, which is a high-level 3D library with a lot of capabilities and a pretty accessible API.  I've been pretty impressed with it so far.

So, I've started a new project (three.qbjs) to create a wrapper API that can be used to access this library from QBJS. Here's an obligatory rotating cube example:

View Source in New Tab

At this point, I've only implemented a small percentage of the three.js API, but it's been pretty interesting to see what is possible.  It is actually pretty straightforward to incorporate other QBJS content into a 3D scene.  Here's an example where we can use one of @bplus' plasma proggies as an animated texture that can be applied to a 3D surface:

Open in New Tab

You can take that idea even further and play your QBJS game on a virtual NES:
   
View Controls:
- Orbit: Left mouse / touch: one-finger move.
- Zoom: Middle mouse, or mousewheel / touch: two-finger spread or squish.
- Pan: Right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger move.
Game Controls:
- As shown on screen

Open in New Tab

And here's a 3D Chess game that uses the same view controls as above (and the same chess engine API as the text-based UI one I posted recently).
   

Open in New Tab

For additional of examples of what might be possible there is a listing of sample programs on the three.js website:
https://threejs.org/examples/

And a couple of apps built with three.js:
FPS Shooter: https://krunker.io/
Driving Sim: https://slowroads.io/

Anyway, more to come, but I wanted to share what I have so far.
Reply


Messages In This Thread
QBJS in 3D - by dbox - 02-23-2026, 08:15 PM
RE: QBJS in 3D - by NakedApe - 02-23-2026, 09:16 PM
RE: QBJS in 3D - by Sprezzo - 02-24-2026, 01:44 AM
RE: QBJS in 3D - by vince - 02-25-2026, 12:35 PM
RE: QBJS in 3D - by grymmjack - 03-01-2026, 04:22 PM
RE: QBJS in 3D - by dbox - 03-02-2026, 12:07 AM
RE: QBJS in 3D - by dbox - 03-02-2026, 05:29 PM
RE: QBJS in 3D - by bplus - 03-02-2026, 06:29 PM
RE: QBJS in 3D - by dbox - 03-02-2026, 08:42 PM
RE: QBJS in 3D - by bplus - 03-03-2026, 02:52 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)