On Jun 29, 10:03 pm, Ondrej Certik <[email protected]> wrote:
> Hi,
>
> I need to use opengl from python and pyglet works fine for that, as
> long as I have X running.
>
> I however need to be able to render offscreen, so that the code can
> also be run on the server with no X and render the results to .png and
> then send it to a Sage notebook.
>
> I wrapped some mesa commands using cython and it just works offscreen.
> So I thought I would just setup the context and then use pyglet to do
> the actual rendering (so that I can use the same code both for on and
> offscreen rendering), however I never managed to get it run. It seem
> the GLU commands work fine, but any transformations (like glTranslate)
> just don't work (seems like it does nothing). If I copy the same code
> line by line to C, and wrap by Cython, it works. If I call the same
> commands from pyglet (ctypes), it doesn't work.
>
> So the bug must be somewhere in pyglet, I suspect it is doing some
> magic on "import pyglet.gl", that breaks things.
>
> So it seems I will have to abandon pyglet and do things myself, more
> details here:
>
> http://groups.google.com/group/hpfem/browse_thread/thread/7c5be4dfd99...
>
> Are there any plans to fix pyglet to work offscreen? I would prefer to
> work with pyglet, so that I am not doing things myself, unless you
> decide you will not support offscreen rendering with pyglet.
Btw, if you want to see a code that doesn't work, for example this
revision shows the problem described above:
http://github.com/certik/osmesa/commit/ee398ae752bce8d7407efa5963a395b28ff8e138
The sphere() gets rendered (using pyglet), but the
glTranslatef(0.75, 0.0, 0)
glTranslatef(0.75, 0.0, 1.0)
don't make any difference (it looks like they are executed in some
other context, or I don't know).
Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---