Code is written in python, uses pyglet to draw lines and vertices. All vertex calculations is done without using 3D methods of any library.
Euler-Roudrigues rotation and rotation about x, y, and z axis are given separately. Rotation method can be selected from code.
Left, right, up, and down arrow keys moves the cube.
x, y, and z keys rotates cube with the specified axes.
This code is for demonstration purposes only, so it is neither optimal nor complete. Use it as is.