Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Graphics: OpenGL in Perl/Tk ... with GLUT

by cavac (Vicar)
on Jan 12, 2023 at 11:28 UTC ( #11149546=note: print w/replies, xml ) Need Help??

in reply to Graphics: OpenGL in Perl/Tk ... with GLUT

A little off topic, but: If you like OpenGL, you could try out WebGL in a browser. Yes, you'd have to use JavaScript, but you could still do a lot of the data munching in Perl and push data on thy fly to the browser side using Websockets+JSON.It's easy enough for a single threaded Perl script (or fork-on-demand if you so choose) to serve multiple clients, so you can even push you real time data to multiple computers all at once ;-)

I can't help you with 3D graphics stuff, but if you ever want to go the route of networking, i'm certainly one of the brains you can pick ;-)

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
  • Comment on Re: Graphics: OpenGL in Perl/Tk ... with GLUT

Replies are listed 'Best First'.
Re^2: Graphics: OpenGL in Perl/Tk ... with GLUT
by haj (Priest) on Jan 12, 2023 at 16:10 UTC

    Thanks for this suggestion! My browser experiments so far were focused on Web3D (and the X3D format to store 3D models).

    I understand that WebGL is similar to OpenGL as a low-level graphics API, targeted at the HTML5 canvas. But like with "pure" OpenGL ... it doesn't come with an event loop and GUI toolkit. That's what I use Tk for, and what I would have to rewrite for the HTML canvas.

    Also, being based on OpenGL ES which is "a well-defined subset of desktop OpenGL suitable for low-power devices", it seems to lack the interactive glRenderMode feature which I need to use. Or maybe I just failed to find it?

      JavaScript doesn't have what you would call an "event loop", it uses callbacks to react to events. As for cyclic stuff (rendering, physics, etc), you just use setInterval().

      As far as communication with the Perl backend, i make extensive use of Websockets. It really depends on your webserver setup on how you do that, but with my own webserver i use a (slightly adapted) version of Protocol::WebSocket::Frame

      PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11149546]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-04-02 02:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found