Repository navigation
๐จ v0.2.5 - Three.js Script Generator
New Feature: desktop_add_threejs_script Tool
Generate battle-tested Three.js scripts for 8th Wall Desktop AR experiences with a single command!
๐ฏ What's New
New MCP Tool: mcp_8thwall_desktop_add_threejs_script
Creates working Three.js scripts that:
โ
Integrate properly with 8th Wall Desktop ECS v2
โ
Handle XR8 pipeline initialization correctly
โ
Work perfectly in AR mode on mobile devices
โ
Include touch/click interaction support
โ
Position objects optimally for AR viewing
โ
Have comprehensive debugging logs
๐ฆ Installation
Download the bundle: mcp-8thwall-0.2.5-threejs.mcpb (6.3 MB)
Add to your MCP configuration in Cursor:
๐ Quick Start
๐ฎ Example: Interactive Color-Changing Sphere
Tested and working on actual mobile devices:
Large, glowing sphere positioned 5m ahead
Tap anywhere to cycle through colors
Smooth rotation animation
Proper 75ยฐ FOV for natural viewing
Touch event handling with debugging
โจ Key Improvements
Correct XR8 Integration
Adds XR8.Threejs.pipelineModule() first
Uses Camera Pipeline Module pattern
Safe initialization in onUpdate callback
Proper Scene Access
Extracts scene/camera from xrScene() wrapper
Handles null checks and error cases
Names all objects to prevent crashes
AR Optimizations
Objects positioned 5 meters ahead (not too close!)
Eye-level placement (1.5m height)
75ยฐ camera FOV for natural view
Touch events with capture phase
๐ Documentation
Included guides:
THREEJS_SCRIPT_GUIDE.md - Complete usage guide
RELEASE-0.2.5.md - Detailed release notes
๐ Bug Fixes
Fixed camera FOV settings for AR mode
Improved touch event handling reliability
Added comprehensive debug logging
Corrected event propagation handling
๐ Lessons Learned
This tool was developed after extensive debugging:
XR8.Threejs.pipelineModule() must be added first
xrScene() returns a wrapper - extract scene/camera
Initialize in onUpdate, check every frame
Name all Three.js objects to prevent errors
AR positioning requires careful distance/height
๐ Tested On
โ
iPhone AR mode
โ
8th Wall Desktop simulator
โ
Touch interactions
โ
Multiple objects in scene
โ
Color changing with animations
Full Changelog: v0.2.4...v0.2.5