Welcome to HandControlledCube! This repository contains code for a simple 3D cube visualization using Pygame, with the ability to control the rotation of the cube using hand gestures detected by a separate module.
-
cube.py: This script initializes a Pygame window and draws a rotating 3D cube. The cube can be rotated using keyboard inputs.
-
CordReader1.py: This script is intended to read hand gesture data from a sensor or file (not provided) and update the rotation angles of the cube accordingly. However, it seems to have the same functionality as cube.py.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/HandControlledCube.git -
Install the required dependencies:
pip install pygame -
Run the
cube.pyorCordReader1.pyscript using Python:python cube.pyor
python CordReader1.py -
Use the keyboard inputs to rotate the cube (
a,d,w,s,q,e,r).
-
Both scripts contain the main loop that updates the rotation of the cube and handles user input.
-
The cube's rotation angles can be modified by changing the values in the
angle_x,angle_y, andangle_zvariables. -
The
angle.jsonfile seems intended to store rotation angles but is not fully utilized in the provided code. -
Feel free to explore and modify the code according to your requirements.
-
This project is inspired by the desire to create interactive 3D visualizations using Python and Pygame.
-
Thanks to the Pygame community for providing helpful resources and tutorials.