PinPortrait is an interactive web experiment that transforms your webcam feed into a dynamic 3D pixel art portrait. This project explores the intersection of computer vision, 3D graphics, and interactive design, offering a unique and engaging user experience.
- Real-time webcam input processing
- 3D representation of pixelated video feed
- Interactive camera controls for exploring the 3D space
- Customizable pixel size and color mapping
PinPortrait uses the following technologies and techniques:
- Webcam Input: Captures live video feed from the user's webcam.
- Canvas Pixelation: Processes the video feed and calculates average color values for each pixel block.
- Three.js 3D Rendering: Creates a 3D scene with cubes representing each pixel.
- Dynamic Updates: Continuously updates cube colors and heights based on the processed video data.
- Interactive Controls: Allows users to orbit, zoom, and pan around the 3D scene.
PinPortrait is designed to be easily customizable. Here are some ways you can modify the project:
- Adjust the
size
variable insketch.js
to change the pixel/cube size - Modify the color mapping in the
setupColors()
function for different visual effects - Experiment with different 3D geometries by replacing the cube mesh in
setupCubes()
- Add post-processing effects using Three.js post-processing library
- Implement additional interactivity, such as click events on individual cubes
To run PinPortrait locally:
- Clone this repository
- Open
index.html
in a modern web browser - Allow access to your webcam when prompted
The performance of PinPortrait depends on the capabilities of the user's device. For optimal perfo