webgl-globe

WebGL Globe

An interactive 3D Earth visualization built with WebGL and Three.js that demonstrates the behavior of bezier curves connecting points on a sphere, featuring dynamic particle effects and performance monitoring.

Live Demo

What is WebGL Globe?

WebGL Globe is a browser-based 3D Earth visualization that showcases advanced WebGL rendering techniques. The application creates mesmerizing visual effects by:

The project serves as both an educational tool for understanding 3D graphics programming and a demonstration of modern web technologies working together to create immersive visual experiences.

Features

Core Visualization

Animation System

Interactive Elements

Technical Features

Built With

Getting Started

The project runs as a static website with no server requirements:

# Clone the repository
git clone https://github.com/galactic-plane/webgl-globe.git
cd webgl-globe

# Install dependencies (for development tools)
npm install

# Start local development server
npm run dev

Alternative Static Servers

# Using Python
cd wwwroot
python -m http.server 8000

# Using any static file server
# Just serve the wwwroot directory

Node.js Development Server (Optional)

npm install
npm start

Project Structure

wwwroot/
├── index.html          # Main globe visualization
├── node.html           # Hero vs villain battle mode
├── css/               
│   ├── materialize.css # UI framework styles
│   └── style.css      # Custom application styles
├── js/
│   ├── globe.js       # Core 3D globe implementation
│   ├── init.js        # Application initialization
│   ├── three.min.js   # Three.js library
│   └── OrbitControls.js # Camera controls
├── img/
│   └── 4k/            # High-resolution Earth textures
│       ├── normal/    # Standard Earth textures
│       ├── cartoon/   # Stylized Earth textures
│       └── frozen/    # Ice age Earth textures
└── sounds/            # Audio effects and background music

Globe API Usage

The globe object provides a simple API for creating animated bezier curves and particle effects:

// Initialize the globe
let container = document.getElementById('globe');
let globeObj = new DAT.Globe(container, { sceneType: 'normal' });

// Create animated curves between points
let originate = [35.1380556, -79.0075]; // Starting coordinates (lat, lng)
let destination = [39.445723, -123.8052935]; // Ending coordinates

// Customize particle appearance
globeObj.particleColor(0x01001f); // Set particle color
globeObj.particleSize(0.03); // Set particle size
globeObj.particleSpeed(0.9); // Set animation speed

// Add dynamic line colors
let color = new THREE.Color(0xffffff);
color.setHex(Math.random() * 0xffffff);
globeObj.lineColor(color);

// Control spike generation
globeObj.enableSpikeOverload(true); // Enable/disable spike effects

Visual Themes

The globe supports multiple visual themes that completely change the appearance:

Performance Monitoring

The application includes comprehensive performance tracking:

Browser Compatibility

WebGL Globe works in all modern browsers that support:

Tested and optimized for Chrome, Firefox, Safari, and Edge.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT