Reader small image

You're reading from  Tkinter GUI Application Development Blueprints

Product typeBook
Published inNov 2015
Reading LevelExpert
PublisherPackt
ISBN-139781785889738
Edition1st Edition
Languages
Right arrow
Author (1)
Bhaskar Chaudhary
Bhaskar Chaudhary
author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary

Right arrow

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

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 in a single row. This is convenient for humans to read. However, as per convention and for some mathematical advantage that we will see later, positions are taken as a column vector. So it is written in a column as follows...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Tkinter GUI Application Development Blueprints
Published in: Nov 2015Publisher: PacktISBN-13: 9781785889738

Author (1)

author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary