45

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?

Antoni4040
  • 2,297
  • 11
  • 44
  • 56
  • Maybe start with a [OpenGL tutorial](http://pyopengl.sourceforge.net/context/tutorials/index.xhtml) – sloth Aug 25 '12 at 12:27
  • possbile duplicate: http://stackoverflow.com/questions/7493611/where-is-there-a-pyopengl-tutorial – sloth Aug 25 '12 at 12:43
  • 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? – Antoni4040 Aug 25 '12 at 12:44
  • 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 Aug 25 '12 at 12:52
  • IMHO: Try some opengl tutorials to get an idea what's opengl is all about, maybe create a little game; then try out Panda3D. – sloth Aug 25 '12 at 12:59
  • Well, Panda3D doesn't seem very good from their screenshots... – Antoni4040 Aug 31 '12 at 09:44
  • Well, but it's easy to use :-) PyOgre is more powerfull IIRC, but also more complex – sloth Aug 31 '12 at 09:46
  • Well, I want to create complex models(even if I want to create "simple" games...), and Panda3D doesn't seem to support that... – Antoni4040 Aug 31 '12 at 09:54
  • Try [ModernGL](https://github.com/cprogrammer1994/ModernGL) you can find the documentation [here](https://moderngl.github.io/) – Szabolcs Dombi May 20 '17 at 12:41
  • I found this [ssentdex.com](http://sentdex.com/) YouTube tutorial very helpful as an entry point to OpenGL from a python perspective; https://www.youtube.com/watch?v=R4n4NyDG2hI – uhoh Oct 02 '17 at 04:39

4 Answers4

32

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.

sloth
  • 99,095
  • 21
  • 171
  • 219
9

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.

Tshirtman
  • 5,859
  • 1
  • 19
  • 26
2

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

http://www.pygame.org/

Drahkar
  • 1,694
  • 13
  • 17
0

If you use Cython there is a possibility to optimise part of your code with OpenCL:

https://github.com/cython/cython/wiki/enhancements-opencl

Datageek
  • 25,977
  • 6
  • 66
  • 70
  • 1
    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. – Jonathan Hartley Aug 10 '16 at 14:09