Skip to content

Interactive 3D visualization of the Earth and Moon system built with React, Three.js, and modern Web APIs. This project demonstrates advanced input handling, responsive design, and real-time 3D graphics.

License

Notifications You must be signed in to change notification settings

edbzed/input-device-api

Repository files navigation

Interactive 3D Earth-Moon Visualization

React TypeScript Three.js Tailwind CSS Vite License

Interactive 3D visualization of the Earth and Moon system built with React, Three.js, and modern Web APIs. This project demonstrates advanced input handling, responsive design, and real-time 3D graphics.

Features

3D Visualization

  • Realistic Earth and Moon models with accurate textures
  • Physically accurate Moon orbit with proper tilt
  • Dynamic lighting and shadows
  • Smooth camera controls and animations

Input Device Integration

  • Device orientation tracking
  • Pressure-sensitive pointer input
  • Gamepad support
  • Touch and mouse controls
  • Real-time event logging

Responsive Design

  • Mobile-first approach
  • Adaptive UI for different screen sizes
  • Sliding panel for mobile navigation
  • Touch-optimized controls

Measurements and Data

  • Real-time space measurements display
  • Earth-Moon distance tracking
  • Planetary diameter information
  • Dynamic event logging system

Input Device

Technologies Used

  • React 18
  • Three.js with React Three Fiber
  • TypeScript
  • Tailwind CSS
  • Lucide React Icons
  • Web APIs:
    • Device Orientation API
    • Pointer Events API
    • Gamepad API

Getting Started

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev

Controls

Desktop

  • Mouse Drag: Rotate view
  • Scroll: Zoom in/out
  • Reset Button: Return to default view
  • Play/Pause: Toggle Moon orbit animation

Mobile

  • One Finger: Rotate view
  • Two Fingers: Pinch to zoom
  • Device Orientation: Automatic view adjustment
  • Menu Button: Access measurements and input data

Creator

Ed Bates (TECHBLIP LLC)

Acknowledgments

Some sections of this code were generated with the assistance of AI tools. These contributions were reviewed and integrated by the project creator(s).

License

Apache-2.0 License - see the LICENSE file for details

About

Interactive 3D visualization of the Earth and Moon system built with React, Three.js, and modern Web APIs. This project demonstrates advanced input handling, responsive design, and real-time 3D graphics.

Resources

License

Stars

Watchers

Forks