Python Game Engine: Introduction to Panda3D
I recently finished playing a game called Ori and the Blind Forest, and… oh my goodness. Hands down, it has the most beautiful graphics and soundtrack I have ever seen or heard (Check it out here: http://store.steampowered.com/app/261570/). Playing such a magnificent game has inspired me to do a bit of research on how such components of a well-designed game are created. A quick search on Quora brought me to Panda3D, a free framework for 3D rendering and game development. You can download it at https://www.panda3d.org/download.php.
Here are some sample shots of projects made using Panda3D. Note that these images are all from the sample gallery of the Panda3D website.
The following is the cumulative code from the Panda3D “A Panda Hello World” tutorial.
Some key words are noted below:
- ShowBase — A class that loads several Panda3D modules and makes the rendering window to appear
- Scene Graph — A data structure represented by a tree that contains all objects that are to be rendered. Here, it is being accessed and modified in the ShowBase class using self.scene
- Task — Controls camera angles. Default settings control camera angles with a mouse
- Actor — A class that loads animated models. There are two constructors for this class: one is the file containing the animated model and the other is the Python dictionary containing the model’s animations
- Intervals and Sequences — Intervals are tasks that change a property’s value after a specified amount of time, while Sequences are tasks that execute one interval after another
When the code is run, the result is a walking panda. Neat!
Thanks for reading! If you find an error in this post, please feel free to comment below and I will do my best to address any issues. Many thanks to the Panda3D and Ori and the Blind Forest developers and community for giving me the inspiration to write a post on this topic.