React Three Fiber • Gesture Control • AI Commands • Real-time 3D Visualization • MediaPipe Integration
- Quick Start
- Overview
- Features
- System Architecture
- Technology Stack
- Installation
- Configuration
- Usage Guide
- AI Commands
- Gesture Controls
- API Reference
- Customization
Get your hologram system running in 3 minutes:
# 1. Clone the repository
git clone https://github.com/minhleeee123/honogram_3D.git
cd honogram_3D
# 2. Install dependencies
npm install
# 3. Configure Gemini API
# Create .env.local file
echo "VITE_GEMINI_API_KEY=your_api_key_here" > .env.local
# 4. Start development server
npm run dev
# 5. Open browser at http://localhost:5173Get Gemini API Key: https://aistudio.google.com/apikey
HoloCore 3D is an interactive holographic particle system that transforms 3D models into stunning particle-based visualizations. Control the hologram through an intuitive interface, natural language AI commands, or hand gesture recognition.
AI-Powered Control
- Natural language commands via Google Gemini
- Intelligent parameter adjustment
- Context-aware responses
Gesture Recognition
- Hand tracking with MediaPipe
- Pinch-to-zoom interaction
- Real-time gesture detection
Interactive 3D Graphics
- Particle-based hologram rendering
- Multiple shape primitives (Torus, Sphere, Helix)
- Real-time parameter tweaking
- Smooth animations and transitions
Responsive Design
- Desktop-optimized interface
- Mobile-friendly controls
- Touch and gesture support
- Particle System: Thousands of particles forming 3D shapes
- Dynamic Shapes: Torus, Sphere, Helix, and custom geometries
- Real-time Rendering: 60 FPS performance with WebGL
- Visual Effects: Glow, bloom, and holographic distortion
- Color Customization: Full RGB color picker
- Glitch Effects: Adjustable holographic interference
- Natural Language Processing: Powered by Google Gemini
- Voice-like Commands: "Increase rotation speed", "Change color to blue"
- Parameter Mapping: AI understands hologram parameters
- Context Awareness: Remembers previous settings
- Multi-language Support: Commands in multiple languages
- Hand Tracking: MediaPipe Hand Landmark Detection
- Pinch-to-Zoom: Scale hologram with finger gestures
- Real-time Processing: Low-latency gesture recognition
- Camera Integration: WebRTC camera access
- Visual Feedback: Hand landmark visualization
- Rotation Speed: Adjust hologram spin rate
- Particle Count: 1,000 to 50,000 particles
- Particle Size: Micro to macro particle scaling
- Color Picker: Full color spectrum selection
- Shape Selector: Switch between geometric primitives
- Effect Toggles: Hover effects, glitch intensity
- Zoom Control: Manual zoom slider
- Conversational UI: Chat-based command input
- Message History: Track command history
- AI Responses: Confirmation and feedback
- Command Suggestions: Helpful command examples
- Error Handling: Graceful failure messages
┌────────────────────────────────────────────────────────────┐
│ USER INTERFACE │
│ (React 19 + TypeScript) │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Control │ │ AI Chat │ │ Gesture │ │
│ │ Panel │ │ Interface │ │ Controller │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
└─────────┼────────────────────┼────────────────────┼────────┘
│ │ │
└────────────────────┴────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ App Component (App.tsx) │ │
│ │ • State Management (hologramConfig) │ │
│ │ • Event Handling (callbacks) │ │
│ │ • Props Distribution │ │
│ └────────────────────┬─────────────────────────────────┘ │
└───────────────────────┼────────────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
│ 3D ENGINE │ │ AI SERVICE │ │ GESTURE SERVICE │
│ │ │ │ │ │
│ React Three │ │ Gemini │ │ MediaPipe │
│ Fiber │ │ API │ │ Hand Detect │
│ │ │ │ │ │
│ • Canvas │ │ • NLP │ │ • Hand Track │
│ • Particles │ │ • Command │ │ • Pinch Detect │
│ • Lighting │ │ Interpret │ │ • Zoom Calc │
│ • Effects │ │ • Response │ │ • Camera Access │
└──────────────┘ └──────────────┘ └──────────────────┘
│ │ │
└─────────────────┴──────────────────┘
│
▼
┌──────────────────────────┐
│ HOLOGRAM STATE │
│ │
│ • rotationSpeed │
│ • particleCount │
│ • particleSize │
│ • color │
│ • shape │
│ • zoomLevel │
│ • glitchIntensity │
└──────────────────────────┘
- Three.js Scene: WebGL rendering context
- Particle System: Instance-based particle rendering
- Camera Controller: OrbitControls for navigation
- Post-processing: Bloom and glow effects
- Performance: Optimized with useMemo and useFrame
- Slider Controls: Numeric parameter adjustment
- Color Picker: RGB color selection
- Dropdown Menus: Shape and preset selection
- Toggle Switches: Effect on/off controls
- Responsive Layout: Mobile/desktop adaptability
- Message Display: Scrollable chat history
- Input Field: Command text entry
- Gemini Integration: API communication
- Loading States: Processing indicators
- Error Handling: Network failure recovery
- MediaPipe Setup: Hand landmark detection model
- Camera Stream: WebRTC video capture
- Gesture Detection: Pinch distance calculation
- Zoom Mapping: Gesture to zoom translation
- Visual Overlay: Hand skeleton rendering
| Component | Technology | Purpose |
|---|---|---|
| UI Framework | React 19.2 | Component-based UI |
| Language | TypeScript 5.8 | Type-safe development |
| 3D Rendering | Three.js 0.181 | WebGL 3D graphics |
| 3D React | React Three Fiber 9.4 | React bindings for Three.js |
| 3D Helpers | React Three Drei 10.7 | Three.js utilities |
| Build Tool | Vite 6.2 | Fast dev server and bundler |
| Styling | Tailwind CSS | Utility-first CSS |
| Component | Technology | Purpose |
|---|---|---|
| AI Model | Google Gemini 1.31 | Natural language processing |
| Gesture Recognition | MediaPipe Tasks Vision 0.10 | Hand tracking |
| Camera Access | WebRTC | Video stream capture |
- Node.js: Runtime environment
- npm: Package manager
- ESLint: Code linting
- Prettier: Code formatting
- Node.js: Version 18.0 or higher
- npm: Version 8.0 or higher
- Modern Browser: Chrome, Firefox, Safari, Edge (WebGL 2.0 support)
- Webcam: Optional, for gesture control
- Gemini API Key: Required for AI features
git clone https://github.com/minhleeee123/honogram_3D.git
cd honogram_3Dnpm installView Dependencies
Production Dependencies:
- react@^19.2.1
- react-dom@^19.2.1
- three@^0.181.2
- @react-three/fiber@^9.4.2
- @react-three/drei@^10.7.7
- @google/genai@^1.31.0
- @mediapipe/tasks-vision@0.10.3
- lucide-react@^0.556.0
Dev Dependencies:
- vite@^6.2.0
- typescript@~5.8.2
- @vitejs/plugin-react@^5.0.0
- @types/node@^22.14.0
Create .env.local file in root directory:
# Google Gemini API Key (required for AI commands)
VITE_GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Development settings
VITE_DEV_MODE=trueGet API Key:
- Visit https://aistudio.google.com/apikey
- Create new API key
- Copy and paste into
.env.local
npm run devApplication will be available at http://localhost:5173
npm run buildProduction files will be in dist/ directory.
Edit App.tsx to customize initial state:
const INITIAL_STATE: HologramState = {
rotationSpeed: 1.0, // Rotation speed (0.1 - 5.0)
particleSize: 0.05, // Particle size (0.01 - 0.2)
particleCount: 5000, // Number of particles (1000 - 50000)
color: '#00f0ff', // RGB hex color
hoverEffect: true, // Enable hover interactions
glitchIntensity: 0.1, // Glitch effect (0 - 1)
shape: 'torus', // Shape type
zoomLevel: 1.0 // Camera zoom (0.5 - 3.0)
};Edit services/geminiService.ts:
const genAI = new GoogleGenerativeAI(
import.meta.env.VITE_GEMINI_API_KEY
);
const model = genAI.getGenerativeModel({
model: "gemini-2.0-flash"
});Edit components/GestureController.tsx:
const handLandmarker = await HandLandmarker.createFromOptions(
vision,
{
baseOptions: {
modelAssetPath: "hand_landmarker.task",
delegate: "GPU" // Use GPU acceleration
},
numHands: 2, // Detect up to 2 hands
minHandDetectionConfidence: 0.5,
minHandPresenceConfidence: 0.5,
minTrackingConfidence: 0.5
}
);- Range: 0.1 (slow) to 5.0 (fast)
- Default: 1.0
- Effect: Controls hologram spin rate
- Range: 1,000 to 50,000 particles
- Default: 5,000
- Effect: Density of hologram
- Performance: Higher counts reduce FPS
- Range: 0.01 (tiny) to 0.2 (large)
- Default: 0.05
- Effect: Size of individual particles
- Format: RGB Hex (#RRGGBB)
- Default: #00f0ff (cyan)
- Effect: Changes particle color
- Options: Torus, Sphere, Helix
- Default: Torus
- Effect: Changes hologram geometry
- Range: 0 (none) to 1 (maximum)
- Default: 0.1
- Effect: Holographic distortion effect
- Range: 0.5 (far) to 3.0 (close)
- Default: 1.0
- Effect: Camera distance from hologram
Shape Changes:
"Change shape to sphere"
"Switch to helix shape"
"Make it a torus"
Color Adjustments:
"Change color to blue"
"Make it red"
"Set color to green"
Speed Control:
"Increase rotation speed"
"Slow down the rotation"
"Set rotation to 2.5"
Particle Adjustments:
"Increase particle count"
"Make particles smaller"
"Set particle size to 0.1"
Effect Controls:
"Add more glitch effect"
"Reduce glitch intensity"
"Turn off hover effect"
Zoom Commands:
"Zoom in"
"Zoom out"
"Set zoom to 2.0"
The AI understands various command patterns:
- Action + Parameter: "increase rotation speed"
- Set + Value: "set particle count to 10000"
- Change + Property: "change color to red"
- Adjective + Noun: "faster rotation"
- Enable Camera: Click "Enable Gesture Control" button
- Show Hand: Hold hand in front of camera
- Pinch Gesture: Bring thumb and index finger together
- Zoom Effect:
- Close pinch = Zoom out
- Open pinch = Zoom in
Optimal Conditions:
- Good lighting
- Hand at 30-60cm from camera
- Clear background
- Steady hand position
Distance Mapping:
- 0-30mm: Zoom level 0.5 (far)
- 30-80mm: Zoom level 1.0 (normal)
- 80-150mm: Zoom level 3.0 (close)
interface HologramState {
rotationSpeed: number; // 0.1 - 5.0
particleSize: number; // 0.01 - 0.2
particleCount: number; // 1000 - 50000
color: string; // Hex color
hoverEffect: boolean; // Enable/disable
glitchIntensity: number; // 0 - 1
shape: 'torus' | 'sphere' | 'helix';
zoomLevel: number; // 0.5 - 3.0
}// Interpret natural language command
async function interpretCommand(
userInput: string,
currentState: HologramState
): Promise<CommandResponse>
interface CommandResponse {
action: 'update_settings' | 'query' | 'error';
settings?: Partial<HologramState>;
message?: string;
}const response = await interpretCommand(
"Change color to blue and increase rotation",
currentHologramState
);
if (response.action === 'update_settings') {
setHologramConfig(prev => ({
...prev,
...response.settings
}));
}Edit components/HologramCanvas.tsx:
const generateShapeParticles = (shape: string, count: number) => {
switch (shape) {
case 'torus':
return generateTorusParticles(count);
case 'sphere':
return generateSphereParticles(count);
case 'helix':
return generateHelixParticles(count);
// Add your custom shape:
case 'cube':
return generateCubeParticles(count);
default:
return generateTorusParticles(count);
}
};Add post-processing effects:
import { EffectComposer, Bloom } from '@react-three/postprocessing';
<EffectComposer>
<Bloom
intensity={1.5}
luminanceThreshold={0.9}
luminanceSmoothing={0.9}
/>
</EffectComposer>Edit Tailwind classes for UI styling:
<div className="bg-slate-900 text-cyan-400 border-cyan-500">
{/* Your component */}
</div>High Performance (60 FPS):
- Particle Count: 5,000 - 10,000
- Particle Size: 0.03 - 0.05
- Effects: Minimal
Balanced (45-60 FPS):
- Particle Count: 10,000 - 20,000
- Particle Size: 0.05 - 0.08
- Effects: Moderate
High Quality (30-45 FPS):
- Particle Count: 20,000 - 50,000
- Particle Size: 0.08 - 0.15
- Effects: Maximum
- Reduce Particle Count: Lower for mobile devices
- Disable Effects: Turn off glitch on low-end hardware
- GPU Acceleration: Ensure WebGL 2.0 is enabled
- Close Unused Tabs: Free up GPU memory
- Update Graphics Drivers: Latest drivers improve performance
| Browser | Version | Support | Notes |
|---|---|---|---|
| Chrome | 90+ | Full | Recommended |
| Firefox | 88+ | Full | Good performance |
| Safari | 14+ | Full | macOS/iOS compatible |
| Edge | 90+ | Full | Chromium-based |
| Opera | 76+ | Full | Chromium-based |
Required Features:
- WebGL 2.0
- WebRTC (for gesture control)
- ES6 modules
- async/await support
Issue: "Failed to load Gemini API"
Error: API key not found
Solution: Check .env.local file has correct VITE_GEMINI_API_KEY
Issue: Camera not working
Error: Permission denied
Solution: Allow camera access in browser settings
Issue: Low FPS / Laggy performance
Symptoms: Below 30 FPS
Solution:
- Reduce particle count
- Lower particle size
- Disable effects
- Close other applications
Issue: Gestures not detected
Hand not recognized
Solution:
- Improve lighting
- Move hand closer to camera
- Ensure clear background
Issue: Build errors
Module not found
Solution: Run npm install again
honogram_3D/
├── src/
│ ├── App.tsx # Main application component
│ ├── index.tsx # Entry point
│ ├── types.ts # TypeScript interfaces
│ ├── components/ # React components
│ │ ├── HologramCanvas.tsx # 3D rendering
│ │ ├── ControlPanel.tsx # UI controls
│ │ ├── AIChat.tsx # Chat interface
│ │ └── GestureController.tsx # Hand tracking
│ └── services/ # Services
│ └── geminiService.ts # AI integration
├── public/ # Static assets
├── index.html # HTML template
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript config
├── package.json # Dependencies
└── README.md # This file
# Install Vercel CLI
npm install -g vercel
# Login
vercel login
# Deploy
vercel
# Set environment variables in Vercel dashboard# Build
npm run build
# Deploy dist/ folder to Netlify
netlify deploy --prod --dir=distSet in deployment platform:
VITE_GEMINI_API_KEY: Your Gemini API key
- Multi-model 3D object import (GLTF, OBJ)
- Voice command recognition
- VR/AR support with WebXR
- Real-time multiplayer synchronization
- Preset gallery and sharing
- Animation timeline editor
- Custom particle shader effects
Contributions welcome! Please:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License.
- AI Studio: https://ai.studio/apps/drive/1j3X-3sRfNlzEbbOMGAxa0aeIBeDGlzxv
- Three.js Docs: https://threejs.org/docs/
- React Three Fiber: https://docs.pmnd.rs/react-three-fiber
- MediaPipe: https://developers.google.com/mediapipe
- Gemini API: https://ai.google.dev/