This set of examples illustrate different computer graphics concepts in 2D and 3D while using: Python, OpenGL core profile, GLFW and Numpy.
Simulating an indirect color scheme with matplotlib
Animation changing the color palette while simulating an indirect color scheme with matplotlib
Using a direct color scheme with sira
Using an indirect color scheme with sira
Sample code to determine OpenGL version available on the current machine. It attempts to set OpenGL core profile 3.3.
Hello OpenGL!
Drawing a Quad via a EBO
Drawing a simple cube with OpenGL
Drawing a deformable shape using GL_STREAM_DRAW
Drawing and transforming polygons with matplotlib
Transforming vertices in the CPU to create shapes.
Drawing 4 shapes with different transformations
Ilustrating different transformations
Controlling the movement of a quad
Simple example using ImGui with GLFW and OpenGL
More info at: https://pypi.org/project/imgui/
Installation: pip install imgui[glfw]
Another example: https://github.com/swistakm/pyimgui/blob/master/doc/examples/integrations_glfw3.py#L2
Interactions with keyboard and mouse via GLFW/python
More information at: https://www.glfw.org/docs/latest/input_guide.html
How to convert GLFW/C calls to GLFW/python https://pypi.org/project/glfw/
Textures and transformations in 2D
Texture Quad in 2D
Using mipmaps
Using 2 different textures in the same Fragment Shader
Example drawing text with OpenGL textures
Drawing many cars in 2D using scene_graph2
Drawing a Snowman using scene_graph
Hermite and Bezier curves using python, numpy and matplotlib
Projections example
Textures and transformations in 3D
plotting a 2d function as a surface
Drawing 3D cars via scene graph
Example drawing 2D over a 3D world. The trick is to not clear the color buffer after drawing 3D, and then draw 2D with the shader.
If it is required to draw 3D over 2D, you may need to clear the depth buffer with glClear(GL_DEPTH_BUFFER_BIT)
Bezier Surface using python, numpy and matplotlib
Showing lighting effects: Flat, Gauraud and Phong
Showing lighting effects over two textured objects: Flat, Gauraud and Phong
Rendering a OBJ file simplified
Using Delaunay triangluation from the scipy library
documentation: https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.Delaunay.html
Face based data structure for a triangle mesh
Using the dedicated face based triangle mesh builder
Using OpenMesh to compute normals for lighting effects
Circles, collisions and gravity
Geometry Shader Basic Example
Adapted from: https://learnopengl.com/code_viewer_gh.php?code=src/4.advanced_opengl/9.1.geometry_shader_houses/geometry_shader_houses.cpp
Render to Texture Example