3D Spinning Cube

Welcome back!!

This week I will be discussing my experience building a spinning cube using the PyOpenGL python binding. I finally know how some of those cool spinning gifs are made.

source.gif

First let’s discuss what PyOpenGL is. According to the PyOpenGL website (http://pyopengl.sourceforge.net/) it is the most common cross platform python binding to OpenGL and related APIs. So, I did a little more research on what a “binding” is and how is it related to this programming language. A biding allows programmers to use a specific programming language as a library or operating system. In this project, I am biding to the ctypes module in the standard library that are usually written in C.

 

ezgif.com-gif-maker.gif

It did not take me long to find the alternative to the “rpigl” module that was suggested in the book. I really wanted to complete this project and to add it to my portfolio because it is very beautiful, fun, and something easy to run after downloading the right requirements for it. The tutorial I followed along with did not take me long either and I ended up building the entire cube in one night. I hope to soon make more 3D graphics in the future and to make them more interactive.

Thanks for reading! ♕