I probably should have said in my original comment that the 3-D rotation itself was only 3 of the 15 lines:
s = 0.1 # sine c = (1 - s**2)**0.5 # cosine ... cube = [(c*x + s*z, y, -s*x + c*z) for x, y, z in cube] # Rotate by theta.
I probably should have said in my original comment that the 3-D rotation itself was only 3 of the 15 lines:
The rest was ASCII art, animation, perspective projection, and geometry generation.