3D graphics with Tkinter

Tkinter's Canvas widget provides for drawing with exact coordinate specifications. Therefore, it can be used to create all sorts of 3D graphics.

Further, we have already seen the animation abilities of Tkinter. We can apply this ability to also animate 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 do a small animation whereby the cube keeps rotating by itself when no mouse intervention occurs.

In its final form, the application would look as follows: 7.17_3D_graphics.py

3D graphics with Tkinter

Any point in a 3D space can be represented by x, y, and z coordinates. ...

Get Tkinter GUI Application Development Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.