This project uses Python, OpenCV, and MediaPipe to read hand gestures from a webcam and control a 3D cube rendered with PyOpenGL. Inspired by the Tony Stark meme, the user can rotate, zoom, and orbit the camera around a 3D object using just hand movement.
- Install these libraries: pygame, pyopengl, opencv-python, numpy, mediapipe
- Just run three.py file
- Additionally, run vision.py to see the program in action
- 🖐️ Hand Tracking via MediaPipe
- 🔄 Rotate, zoom, and orbit the camera around a 3D cube
- 🧭 Colored axis and grid lines for reference
- 🧱 Loads
.objmesh files (optionally with texture support) - ⚙️ Wireframe and solid rendering modes
- 🎮 Keyboard navigation (WASDQE keys to move camera)
PythonOpenCVMediaPipePyOpenGLPygame(used to create the OpenGL window)
| Action | Input |
|---|---|
| Orbit Left/Right | A / D |
| Orbit Up/Down | W / S |
| Toggle Wireframe | M |
You can map gestures like:
- Pinch (thumb + index) right hand: for zoom
- Point (index and thumn) left hand: for rotation
Currently, OpenCV and MediaPipe identify hands using .multi_handedness, which you can parse to differentiate gestures from left/right hand.