A real-time 3D head-tracking demo that creates a realistic "window into a virtual world" effect using your webcam. Built with Three.js and MediaPipe FaceMesh.

The off-axis projection effect creates a realistic "window into a virtual world" - move your head to experience true 3D depth on a 2D screen!
Visit the live demo at: [Your Demo URL]
Or run locally:
# Clone the repository
git clone https://github.com/MindDock/off-axis-demo.git
cd off-axis-demo
# Start a local server (Python 3)
python3 server.py
# Open http://localhost:8000 in your browser
Once the demo is running, you'll have access to:
Download Models: Visit Sketchfab and download GLTF format models
Add to Project:
models/ ├── default/ # Default model (included) │ └── scene.gltf └── your-model-name/ # Your custom model ├── scene.gltf └── textures/ # If applicable
Register in Code: Edit index.html and add your model to the models object:
const models = {
'Original': './models/default/scene.gltf',
'Your Model': './models/your-model-name/scene.gltf',
// ... other models
};
makePerspective() with asymmetric frustum parameters based on head positionKey parameters in index.html:
const SCREEN_WIDTH_CM = 30.0; // Virtual screen width
const SCREEN_HEIGHT_CM = 20.0; // Virtual screen height
const BOX_DEPTH_CM = 80.0; // Chamber depth
const SENSITIVITY = 2.5; // Head tracking sensitivity
The cyberpunk grid environment can be customized by modifying the createEnvironment() function:
stepX and numZLinesgridUniforms.color (default: 0x00ffff cyan)distFade calculationThree light sources are configurable:
Requirements:
This project is licensed under the MIT License - see the license.txt file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Project Link: https://github.com/MindDock/off-axis-demo
Note: This demo works best when viewing from a distance of 40-80cm from your screen. Move your head around to experience the 3D effect!