To my knowledge, there are three online OpenGL tutorials which stand head and shoulders above the rest:
- Learning Modern 3D Graphics Programming Through OpenGL (C)
- An intro to modern OpenGL (C)
- Learning WebGL (Javascript)
I recently started porting the first of these from C to Python.
https://bitbucket.org/tartley/gltutpy
This is primarily for my own benefit, and I’ve only done the first two chapters thus far, but others may find some use in seeing the translation. If anyone else is interested enough to want to contribute, drop me a line and I’ll happily grant commit rights.
I recently started porting the same one to Scala (at https://github.com/vogre/lwjgltut).
<>
Anyway, it’s a great tutorial, good luck with the port.
Looking forward to the port.
Just tried running “t01.hello-triangle”. Here is what I got:
Traceback (most recent call last):
File “HelloTriangle.py”, line 129, in
main()
File “HelloTriangle.py”, line 123, in main
init()
File “HelloTriangle.py”, line 89, in init
initialize_program()
File “HelloTriangle.py”, line 69, in initialize_program
compileShader(strFragmentShader, GL.GL_FRAGMENT_SHADER)
File “/usr/lib/python2.7/site-packages/OpenGL/GL/shaders.py”, line 162, in compileShader
shaderType,
RuntimeError: (“Shader compile failure (0): 0(4) : error C5060: out can’t be used with non-varying outputColor\n”, ['\n#version 120\n\nout vec4 outputColor;\nvoid main()\n{\n outputColor = vec4(1.0f, 1.0f, 1.0f, 1.0f);\n}\n'], GL_FRAGMENT_SHADER)
Blindly, changed “out vec4 outputColor;” to “varying out vec4 outputColor;” and it worked.
@jarav Thanks for the comment. No doubt I’m introducing errors in converting the original OpenGL 3 shaders into something my 2.1 drivers will accept.
I too have a rather old graphics card that supports only 2.1.