Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

3D Cube Rotation Animation

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.

Features

  • 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.

Prerequisites

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)

Installation

You can install the necessary Python packages using pip:

pip install numpy matplotlib ipython

Usage

Simply execute the notebook cells. The script will:

  1. Initialize the cube vertices and edges.
  2. Define a rotation function that updates the cube's orientation for each frame.
  3. Render the animation and display it as an embedded HTML5 video.

About

This script generates a 3D cube and animates its rotation using matplotlib.animation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages