January 2021
Intermediate to advanced
688 pages
19h 22m
English
Beyond chapter 3, when we start writing programs that transform and animate graphics, I use OpenGL and PyGame instead of Matplotlib. This appendix provides an overview of how to set up a game loop in PyGame and render 3D models in successive frames. The culmination is an implementation of a draw_model function that renders a single image of a 3D model like the teapot we used in chapter 4.
The goal of draw_model is to encapsulate the library-specific work, so you don’t have to spend a lot of time wrestling with OpenGL. But if you want to understand how the function works, feel free to follow along in this appendix and play with the code yourself. Let’s start with our octahedron ...
Read now
Unlock full access