1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

ctx path to pyglet?

Posted by Tina on Aug 14, 2009

Hi there,

I'm using the nodebox modules with pyglet and I'm wondering if there is a way to draw nodebox ctx-content (especially paths) directly to the pyglet window? At the moment I'm saving my (quite complex) ctx-paths as images and load them into the pyglet window...

- Tina


 
Posted by Tom De Smedt on Aug 31, 2009

Short answer: no, NodeBox uses Quartz to render stuff, Pyglet uses OpenGL. There is no way to exchange between both projects aside from exporting an intermediate format (like an image or a svg or something) and then importing that in Pyglet.

Longer answer: there is a NodeBox/GL version in the repository here which emulates the nodebox commands on top of pyglet. The project isn't very well documented at this point and there may be differences (e.g. there is no transform(CENTER) in the opengl version). There's also no GUI. But it has most of the nodebox commands in the reference and it renders in opengl, so you may be able to copy-paste code from nodebox-scripts and visualize those in nodebox/gl...



Posted by jack on Apr 26, 2012

There is so many different for this. You are able to get so much from this work. I see so many options to use for this. I think you definitely have the right idea for this.
Separation Agreement Ontario