[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] PyGame / PyOpenGL Example
Apart from Richards shameless self promotion of pyglet, here's some
other things to look at...
Have a look in the Demo directory of pyopengl for many goodies. It's
an often overlooked place of python opengl code.
If you want to render text in 3d: http://ttfquery.sourceforge.net/
soya, openglcontext, python-ogre, blender, vision egg, visual
python... the all have text stuff. Have a look here for more goodies:
http://www.vrplumber.com/py3d.py
And here's how to use pygame gui libraries(pgu, ocemp etc) with opengl:
http://pitchersduel.python-hosting.com/browser/branches/Lamina/
There's some easy to use demos included with Lamina using pygame to
render in 2D and only updating the screen as needed.
Also have a look at http://pygame.org/wiki/CookBook There appears to
be some text things in there too.
Good idea about adding to pygame examples of such a common thing.
Mostly people go to the pyopengl Demo directory for opengl stuff - but
we should put something like this into pygame too. Maybe Lamina
itself should be included with pygame.
For now the cookbook would be a great place to put examples for this.
cu,
On Feb 13, 2008 7:56 AM, Richard Jones <richardjones@xxxxxxxxxxxxxxxx> wrote:
> On Wed, 13 Feb 2008, kschnee wrote:
> > Loading images and
> > displaying those and text is a royal pain in OpenGL, even in Python.
>
> The "even in Python" is a little out of date now :)
>
> from pyglet import image, font
>
> # display an image
> im = image.load('image.png')
> im.blit()
>
> # display some text
> t = font.Text(font.load('', 24), 'Hello, world!')
> t.draw()
>
>
> Richard
>