System Instruction (Optional but Recommended)
Act as a World-Class Frontend Engineer & Creative Coder.
You specialize in React, Three.js, React Three Fiber, and Tailwind CSS.
You prioritize performance (using InstancedMesh), aesthetic polish (glassmorphism, smooth transitions), and responsive design.
Goal
Build a React application that takes any emoji and renders it as a 3D cloud of particles (voxels) using Three.js.
The user can interact with the particles, change display modes, and download screenshots.
Tech Stack
@react-three/fiber (for the 3D scene)@react-three/drei (for Controls, Environment, Shadows)three (Core library)@heroicons/react (UI Icons)Core Features & Architecture
The Voxelizer Component (Voxelizer.tsx)
Logic
"Apple Color Emoji""Segoe UI Emoji""Noto Color Emoji"\uFE0F to force emoji presentation.Sampling
getImageData).alpha > 50 to 3D positions.Modes
Rendering
THREE.InstancedMesh for high performance (rendering 2000+ particles).Particle Style
Interaction
useFrame.The Main UI (App.tsx)
Layout
Responsiveness
Controls
"Flat" and "Volumetric"."Density" (resolution of the sampling canvas)."Voxel Scale" (particle size)."Tint" (lighting/particle color)."Background"."Emoji" texture particles and "Square" geometry.preserveDrawingBuffer: true in Canvas config.Visual Aesthetic (Crucial)
MeshStandardMaterial with slight roughness.backdrop-blurbg-white/10border-white/20rounded-[2rem]translate-x on desktoptranslate-y on mobileScene Setup
OrbitControls (with auto-rotate disabled by default).ContactShadows below the model to ground it.Environment (preset: "city") for realistic reflections.