UNPKG

handible

Version:

Revolutionary hand tracking and gesture control for the web. Transform any webcam into a powerful 3D controller with MediaPipe and Three.js.

227 lines (161 loc) โ€ข 7.24 kB
<div align="center"> <img src="./assets/logo.png" alt="Handible Logo" width="120"/> # H a n d i b l e **Revolutionary hand tracking and gesture control for the web** *Transform any webcam into a powerful 3D controller* --- [![npm version](https://img.shields.io/npm/v/handible.svg?style=for-the-badge&logo=npm&color=ff6b6b)](https://www.npmjs.com/package/handible) [![MIT License](https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge)](./LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/gust10/Handible.svg?style=for-the-badge&logo=github&color=4ecdc4)](https://github.com/gust10/Handible) [![Live Demo](https://img.shields.io/badge/๐Ÿš€-Live%20Demo-purple.svg?style=for-the-badge)](https://demo.handible.dev) [![Three.js](https://img.shields.io/badge/Three.js-000000?style=for-the-badge&logo=three.js&logoColor=white)](https://threejs.org/) [![MediaPipe](https://img.shields.io/badge/MediaPipe-4285F4?style=for-the-badge&logo=google&logoColor=white)](https://mediapipe.dev/) [![WebGL](https://img.shields.io/badge/WebGL-990000?style=for-the-badge&logo=webgl&logoColor=white)](https://www.khronos.org/webgl/) </div> <br/> <div align="center"> ### โœจ **60fps Real-time** โ€ข ๐ŸŒ **Web-based** โ€ข ๐Ÿš€ **Zero Setup** </div> --- ## ๐ŸŽฌ Demo <div align="center"> ```bash npm install handible ``` **[๐Ÿ“– Documentation](https://docs.handible.dev)** โ€ข **[โšก Try Demo](https://demo.handible.dev)** โ€ข **[๐Ÿš€ Get Started](https://docs.handible.dev/getting-started)** </div> <!-- TODO: Add demo GIF/video here ![Handible Demo](https://via.placeholder.com/800x400/4ecdc4/ffffff?text=Handible+Demo) --> ## ๐ŸŒŸ Why Handible? **Handible** makes hand tracking accessible to every developer. No expensive hardware, no complex setupโ€”just your webcam and imagination. Super easy to use. ```javascript import { startGestureControl, isPinching2D } from 'handible'; // ๐Ÿš€ Start tracking await startGestureControl(videoElement, scene); // ๐ŸŽฏ Detect gestures if (isPinching2D(0)) { console.log('Hand 0 is pinching! ๐Ÿค'); } ``` <div align="center"> <table> <tr> <td align="center">๐ŸŽฅ<br/><b>Webcam Only</b><br/>No special hardware</td> <td align="center">โšก<br/><b>60fps Performance</b><br/>Real-time tracking</td> <td align="center">๐ŸŽฏ<br/><b>21 Hand Points</b><br/>Precise detection</td> <td align="center">๐Ÿ”ง<br/><b>Easy Integration</b><br/>Drop-in solution</td> </tr> </table> </div> ## ๐Ÿš€ Features ### ๐ŸŽฎ **Core Capabilities** - **๐Ÿค Pinch Detection** - Precise finger-to-thumb interactions - **๐Ÿ‘‹ Palm Recognition** - Detect palm orientation and facing direction - **๐Ÿ“ 3D Hand Tracking** - Real-time 21-point hand landmarks - **๐ŸŽฏ Multi-Hand Support** - Track up to 2 hands simultaneously - **๐ŸŽจ Surface Interaction** - Virtual buttons, sliders, and UI panels ### ๐Ÿ› ๏ธ **Developer Experience** - **๐Ÿ“ฆ Zero Config** - Works out of the box with Three.js - **๐Ÿ”ง Modular API** - Use only what you need - **๐ŸŽจ Customizable** - Extensive styling and behavior options - **โšก Performance Optimized** - GPU-accelerated tracking ## ๐Ÿ“ฆ Installation ```bash # npm npm install handible # yarn yarn add handible # pnpm pnpm add handible ``` ## โšก Quick Start ### 1. **Basic Setup** ```javascript import { startGestureControl, setSceneObjects } from 'handible'; // Initialize hand tracking const videoElement = document.querySelector('#video'); const scene = new THREE.Scene(); await startGestureControl(videoElement, scene); setSceneObjects(scene, camera, renderer); ``` ### 2. **Detect Gestures** ```javascript import { isPinching2D, getHandPosition } from 'handible'; // Check for pinch gesture if (isPinching2D(0)) { const position = getHandPosition(0); console.log('Pinching at:', position); } ``` ### 3. **Surface Interactions** ```javascript import { SurfaceInteractionSystem } from 'handible'; // Create interactive surface const surface = new THREE.Mesh(geometry, material); SurfaceInteractionSystem.registerSurface(surface, { width: 2, height: 1.5, cursorScaleFactor: 3.0 }); ``` ## ๏ฟฝ Documentation | Section | Description | |---------|-------------| | **[๐Ÿš€ Getting Started](https://docs.handible.dev/getting-started)** | Installation and basic setup | | **[๐Ÿ’ก Core Concepts](https://docs.handible.dev/core-concepts)** | Understanding gestures and tracking | | **[๐Ÿ“š API Reference](https://docs.handible.dev/api-reference)** | Complete function documentation | | **[๐ŸŽฏ Advanced Features](https://docs.handible.dev/advanced-features)** | Surface systems and custom interactions | ## ๐ŸŽฏ Use Cases <div align="center"> <table> <tr> <td align="center">๐ŸŽฎ<br/><b>3D Games</b><br/>Natural hand controls</td> <td align="center">๐ŸŽจ<br/><b>Creative Tools</b><br/>Gesture-based design</td> <td align="center">๐Ÿ“Š<br/><b>Data Visualization</b><br/>Interactive exploration</td> <td align="center">๐Ÿซ<br/><b>Education</b><br/>Immersive learning</td> </tr> <tr> <td align="center">๐Ÿ›๏ธ<br/><b>E-commerce</b><br/>Product interaction</td> <td align="center">๐Ÿฅ<br/><b>Healthcare</b><br/>Touchless interfaces</td> <td align="center">๐ŸŽญ<br/><b>Entertainment</b><br/>Interactive experiences</td> <td align="center">๐Ÿ”ฌ<br/><b>Research</b><br/>Gesture analysis</td> </tr> </table> </div> ## ๐Ÿ› ๏ธ Built With - **[Three.js](https://threejs.org/)** - 3D graphics and rendering - **[MediaPipe](https://mediapipe.dev/)** - Real-time hand tracking - **[WebGL](https://www.khronos.org/webgl/)** - GPU-accelerated performance ## ๐Ÿค Contributing We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details. <div align="center"> **[๐Ÿ› Report Bug](https://github.com/gust10/Handible/issues)** โ€ข **[๐Ÿ’ก Request Feature](https://github.com/gust10/Handible/issues)** โ€ข **[๐Ÿ’ฌ Discussions](https://github.com/gust10/Handible/discussions)** </div> ### Development Setup ```bash git clone https://github.com/gust10/Handible.git cd Handible npm install npm run dev ``` ## ๐Ÿ“Š Performance | Metric | Value | Description | |--------|-------|-------------| | **Frame Rate** | 60fps | Real-time tracking performance | | **Latency** | ~16ms | Input to response time | | **Hand Points** | 21 | Landmark precision per hand | | **Max Hands** | 2 | Simultaneous tracking | ## ๐Ÿ“„ License MIT License - see the [LICENSE](./LICENSE) file for details. ## ๐Ÿ™ Acknowledgments - **MediaPipe Team** - For the incredible hand tracking technology - **Three.js Community** - For the powerful 3D graphics framework - **Contributors** - Everyone who helped make this project better --- <div align="center"> **Made with โค๏ธ by [Hyunsung Shin](https://github.com/gust10)** *Transform your ideas into gestures* โญ **Star this repo if you find it useful!** โญ </div>