Tkinter's Canvas widget provides for drawing with exact coordinate specifications. Therefore, it can be used to create all sorts of 3D graphics. Furthermore, we have already seen the animation abilities of Tkinter. We can apply these abilities to also animate in 3D.
Let's create a simple application where we create a cube in the center. We add event listeners to rotate the cube on mouse events. We also make a small animation in which the cube keeps rotating by itself when no mouse intervention occurs.
In its final form, the application would look as follows (8.13_3D_graphics.py):
Transposing or unzipping can be done in Python by using the special * operator, any point in a 3D space can be represented by x, y, and z coordinates. This is usually represented by a vector of the form:
This is an example of a row vector as all three points are written...