How pmndrs/drei works
Main System Components
The system should be organized into these primary sections:
a) Core Components Layer
• Connection to Three.js core functionality
b) Feature Categories Layer
• Components into major categories as shown in the file structure:
• Cameras
• Controls
• Gizmos
• Abstractions
• Shaders
• Loaders
• Performance
• Portals
• Staging
c) Integration Layer
• Integration with React ecosystem
• Connection points with @react-three/fiber
• Web and native platform support
Component Relationships
• Dependencies between components
• Data flow patterns
• Hook relationships
• Event handling paths
• Blue: Core components
• Green: Helper utilities
• Orange: Performance-related components
• Purple: Visual effects and materials
• Gray: Development tools
• Rectangles: Main components
• Hexagons: Hooks
• Circles: Utilities
• Diamonds: Entry points
Detailed Component Structure
Create nested groupings for:
a) Core Functionality
• Cameras
• PerspectiveCamera
• OrthographicCamera
• CubeCamera
• Controls
• OrbitControls
• TransformControls
• Other control variants
b) Advanced Features
• Materials
• Custom Shaders
• Material Modifiers
• Effects
• Post-processing
• Environmental
• Optimization
• Performance Monitors
• Adaptive Systems
Integration Points
Clear connection points for:
• Three.js integration
• React component lifecycle
• Event system handling
• Asset loading pipeline
Development Tools Integration
Sections for:
• Storybook integration
• Testing utilities
• Development helpers
• Performance monitoring