Skip to content

kimseongyu/3d-fireworks-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

3D Fireworks Simulation

A 3D fireworks simulation application built with Next.js, Three.js, and Rust (WebAssembly). This project demonstrates high-performance 3D graphics rendering in the browser and allows users to compare the performance between a pure JavaScript implementation and a Rust-based WebAssembly implementation.

Features

  • 3D Visualization: Realistic fireworks rendering using Three.js.
  • Dual Rendering Engine:
    • JavaScript Mode: Standard implementation using TypeScript.
    • WebAssembly Mode: High-performance implementation using Rust.
  • Firework Types:
    • Peony: Round shaped firework.
    • Chrysanthemum: Chrysanthemum shaped firework.
    • Willow: Willow tree shaped firework with trailing tails.
    • Ring: Ring shaped firework.
    • Palm: Palm tree shaped firework.
    • Multi-Break: Multi-stage explosion firework.
  • Interactive Controls: Sidebar interface to switch firework types and rendering engines.
  • State Management: Efficient state handling using Zustand.

Tech Stack

Prerequisites

Before running this project, ensure you have the following installed:

Getting Started

  1. Clone the repository (if you haven't already):

    git clone <repository-url>
    cd 3d-fireworks-simulation
  2. Install JavaScript dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Build the WebAssembly module: This step compiles the Rust code in wasm-lib/ to a WebAssembly package.

    npm run build:wasm
  4. Run the development server:

    npm run dev
  5. Open the application: Open http://localhost:3000 with your browser to see the simulation.

Project Structure

/
β”œβ”€β”€ app/                  # Next.js App Router pages and layout
β”œβ”€β”€ components/           # React components
β”‚   β”œβ”€β”€ canvas/           # 3D Canvas and rendering components
β”‚   └── sidebar/          # UI controls and sidebar
β”œβ”€β”€ lib/                  # Utility functions
β”‚   β”œβ”€β”€ three/            # Three.js logic (JS implementation)
β”‚   └── ...
β”œβ”€β”€ model/                # Data models and configurations
β”œβ”€β”€ store/                # Zustand state management
β”œβ”€β”€ wasm-lib/             # Rust source code for WebAssembly
β”‚   β”œβ”€β”€ src/              # Rust logic files
β”‚   └── Cargo.toml        # Rust package configuration
└── ...

Learn More

About

3D fireworks simulation πŸŽ‡

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors