[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] PYGGEL reboot



On sab, 2015-01-24 at 21:23 +0100, Lucas Wagner wrote:
> pyglet is both 2d and 3d.  Try the attached (if attachments are
> allowed, otherwise consider the opengl example coming with pyglet) and
> press F1, F2, and F3 to change between 2d (pygame-like), 3d isometric,
> and 3d perspective views. 

At a quick glance it appears that the only pyglet code in that example
is to setup an OpenGL context. The rest of the code is OpenGL, which is
what is actually drawing in 3D, and old-style (deprecated) OpenGL at
that.

It's interesting that pyglet appears to package OpenGL as a submodule
though.

I'm pretty sure that example would work identically if I changed the
couple of pyglet calls with calls to pygame. And changed the
'from pyglet.gl import *' import to 'from OpenGL.GL import *' in order
to use pyopengl directly.


Anyway, the important thing is that this example uses OpenGL directly.
The point of the discussed 3D graphic library is to provide a layer of
abstraction over OpenGL, to support loading models from files etc.

This way you would be able to load a model and draw it into a scene with
only a couple of calls. Rather than messing around with all the low
level OpenGL stuff.

Attachment: signature.asc
Description: This is a digitally signed message part