A Next-Gen Augmented Reality Interface in Your Browser
Interact with 3D holograms using just your webcam and bare hands. No controllers required.
HoloGraphic is an immersive, browser-based augmented reality experiment that transforms your screen into a Tony Stark-style holographic laboratory. By combining Machine Learning computer vision with WebGL 3D rendering, the application tracks your hand movements in real-time and maps them into 3D space, allowing you to seamlessly manipulate neon geometries.
- Zero Setup Tracking: Uses Google's MediaPipe AI to detect 21 3D landmarks on your hands natively in the browser.
- Physical Scaling: Dynamically calculate the Euclidean distance between your thumb and index finger to scale objects on screen.
- Collision Detection: Spatial mapping allows the system to know exactly when your virtual fingertip touches the surface of the 3D geometry.
- Glassmorphism HUD: A sleek, futuristic UI overlay that lets you swap between different geometrical constructs instantly.
Click the Live Demo link above, grant camera permissions, and wait a few seconds for the AI model to initialize.
| Gesture | Action | Mechanics |
|---|---|---|
| 🤏 Right Hand Pinch | Scale Geometry | Hold your right hand up. Pinch your thumb and index finger close together to shrink the shape, or pull them apart to enlarge it. |
| 👆 Left Hand Touch | Change Color | Hold your left hand up. Move your index fingertip so that it physically intersects the 3D shape on your screen. It will instantly burst into a new neon color. |
| 🖱️ UI Click | Change Shape | Use your mouse to click the [Sphere], [Cube], or [Torus] buttons in the top right corner to instantly swap the holographic geometry. |
HoloGraphic is built using a highly optimized, vanilla web stack to ensure maximum framerates for AI tracking.
The 3D environment is rendered over a transparent WebGL canvas overlaid exactly on top of your mirrored webcam feed.
- The geometry consists of a
THREE.Groupcontaining a solid mesh with additive blending (opacity: 0.5) and a glowing wireframe mesh. - The scene is continuously rotated inside the
requestAnimationFrameloop, and the opacity pulses dynamically using a Sine wave function based onDate.now().
MediaPipe runs a lightweight neural network directly in your browser.
- It captures video frames and returns an array of 21 (x, y, z) coordinates for each detected hand.
- We differentiate between
LeftandRighthands to assign different interactive tools (Scaling vs. Painting/Coloring).
To make your physical hand interact with virtual objects, we map the normalized [0.0 to 1.0] coordinates from MediaPipe into the Three.js world space:
const worldX = (indexTip.x - 0.5) * 16;
const worldY = (0.5 - indexTip.y) * 12;By calculating the 3D distance between your fingertip and the sphere's bounding box, we achieve seamless collision detection.
If you want to modify the code or run it locally:
-
Clone the repository:
git clone https://github.com/VisionStack-404/HoloGraphic.git cd HoloGraphic -
Serve the files: Webcam access strictly requires a secure context (
https://) orlocalhost. You cannot simply open theindex.htmlfile in your browser. Use a local server:Using Node.js:
npx serve .Using Python:
python -m http.server 3000
-
Open your browser and navigate to
http://localhost:3000.
If you pushed this code to your GitHub and want it to be hosted live for free at https://visionstack-404.github.io/HoloGraphic/, you must manually turn on GitHub Pages in your repository settings.
- Go to your repository on GitHub.
- Click the ⚙️ Settings tab near the top right.
- On the left-hand sidebar, click on Pages.
- Under the Build and deployment section:
- For Source, select Deploy from a branch.
- For Branch, select
main(ormaster) from the dropdown. - Leave the folder as
/ (root). - Click Save.
- Wait about 1-2 minutes. GitHub is now building your site. Once complete, your live demo link will work!