This project provides a Python script to generate a smooth 3D cube rotation animation using numpy and matplotlib. The output is optimized for display in Jupyter environments like Google Colab using IPython.display.HTML.
- Mathematical representation of a 3D cube.
- Real-time rotation matrix calculations (X and Y axes).
- Dynamic animation generation using
FuncAnimation. - HTML5 video export for interactive notebooks.
To run this script locally, ensure you have the following installed:
- Python 3.x
- NumPy
- Matplotlib
- IPython
- FFmpeg (required for saving/displaying animations as HTML5 video)
You can install the necessary Python packages using pip:
pip install numpy matplotlib ipythonSimply execute the notebook cells. The script will:
- Initialize the cube vertices and edges.
- Define a rotation function that updates the cube's orientation for each frame.
- Render the animation and display it as an embedded HTML5 video.