Using OpenGL with Python

68,038

Solution 1

You should go on and read a OpenGL tutorial.

Here's a pyopengl demo; other samples are over here.

Also, you can use pygame together with pyopengl; an example is here.

Solution 2

You can try with something higher level, if you want do to simple games, Panda3D has a reputation of being very simple (compared to straight opengl) to learn.

Solution 3

If your goal is to make games in Python, then you should look at PyGame. Its better documented and supported.

http://www.pygame.org/

Share:
68,038

Related videos on Youtube

Antoni4040
Author by

Antoni4040

Trying to create beautiful and interesting websites and possibly make some money as well...

Updated on July 09, 2022

Comments

  • Antoni4040
    Antoni4040 almost 2 years

    So, I only know how to use Python, but I also know how to model in 3d. I've heard of OpenGL and I really want to learn how to use, because it seems very useful (I want to create simple games with it...). I found PyOpenGL, Python bindings for OpenGL, but I couldn't find any "real" documentation, so the only option is to study code examples and tutorials written in C++ or something. But, as I said, I only know how to use Python. What can I do about that?

    • sloth
      sloth over 11 years
      Maybe start with a OpenGL tutorial
    • sloth
      sloth over 11 years
    • Antoni4040
      Antoni4040 over 11 years
      I'm confused. I also know PyOgre and Panda3D but there seem to be different from OpenGL, am I right? (sorry for silly questions, I'm a noob, really...) What sould I use?
    • sloth
      sloth over 11 years
      PyOgre (just python bindings fo Ogre) and Panda3D are complete 3D-engines (that offer a lot of features), while raw OpenGL is very low-level.
    • sloth
      sloth over 11 years
      IMHO: Try some opengl tutorials to get an idea what's opengl is all about, maybe create a little game; then try out Panda3D.
    • Antoni4040
      Antoni4040 over 11 years
      Well, Panda3D doesn't seem very good from their screenshots...
    • sloth
      sloth over 11 years
      Well, but it's easy to use :-) PyOgre is more powerfull IIRC, but also more complex
    • Antoni4040
      Antoni4040 over 11 years
      Well, I want to create complex models(even if I want to create "simple" games...), and Panda3D doesn't seem to support that...
    • Szabolcs Dombi
      Szabolcs Dombi almost 7 years
      Try ModernGL you can find the documentation here
    • uhoh
      uhoh over 6 years
      I found this ssentdex.com YouTube tutorial very helpful as an entry point to OpenGL from a python perspective; youtube.com/watch?v=R4n4NyDG2hI
  • Antoni4040
    Antoni4040 over 11 years
    I know about PyGame, but I want to create (simple) 3D games and PyGame doesn't support 3D elements(I think...).
  • sloth
    sloth over 11 years
    Nonetheless, you can combine pygame and pyopengl
  • Jonathan Hartley
    Jonathan Hartley over 7 years
    Did you mean to say OpenCL? I don't think that is related to Cython. Game-like code can be optimised with Cython, relatively easily. Using OpenCL to distribute computation across arrays of GPUs, FGPAs, etc, is an advanced technique that is not normally used in game-like projects, but rather in projects like SETI, which need to churn through massive amounts of CPU processing.