Skip to content

Abdalrahman-Alhamod/Submarine-Simulation-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Submarine Simulation System ๐Ÿ›ฅ๏ธ

GitHub License Node Version Vite Contributors GitHub Forks GitHub Stars GitHub Last Commit GitHub Repo Size GitHub Language Count GitHub Code Size GitHub Issues Closed GitHub Contributors GitHub Watchers Vercel Deployment Platform Open Issues Closed Issues

Project Screenshot

Welcome to the Submarine Simulation System! This project is a real-time 3D submarine simulation developed for a college project. It provides users with an immersive experience navigating various submarine models in a realistic, interactive ocean environment. This system was built with scientific precision in mind, incorporating advanced physics, hydrodynamics, and fluid mechanics to ensure accuracy. ๐ŸŒŠ

Features ๐ŸŒŸ

  • Real-time Submarine Simulation: Navigate submarines with precise controls in a beautifully rendered 3D oceanic environment. โ›ด๏ธ

  • Physics-Based Simulation: The simulation uses realistic physics, including wave interactions, buoyancy, and underwater dynamics, offering an authentic experience. ๐ŸŒŠ

  • Multiple Submarine Models: Choose between different submarine classes (Typhoon and Ohio), each with unique characteristics and customizable controls. ๐Ÿšค

  • Comprehensive Control Panel: Modify submarine controls like rudders, fairwater, engine speed, and ballast tanks. ๐Ÿšฆ

  • Interactive Environment: Experience both surface and underwater environments with accurate light refraction, shading, and sound dynamics based on the submarineโ€™s position. ๐ŸŽฎ

  • Responsive Camera Views: Control the camera freely or lock it to follow the submarine, providing versatile perspectives. ๐ŸŽฅ

  • Sound Dynamics: Sound changes based on whether you're above or below the water surface. The engine sound adjusts based on speed and proximity. ๐Ÿ”Š

  • Modular Design: Built with extensibility in mind, allowing for easy customization and future feature additions. ๐Ÿ”ง

  • Vite Build Integration: Fast development workflow powered by Vite. โšก

Scientific and Technical Insights ๐Ÿ”ฌ

The physics behind this simulation are based on advanced fluid dynamics and mechanical principles derived from research and a master's thesis on hydrodynamics. Here's an overview of key technical aspects:

  1. Submarine Control Physics:

    • Rudder: Controls the yaw movement (left-right steering).
    • Fairwater and Stern: Control pitch and depth (up-down motion).
    • Propeller Dynamics: Speed is tied to engine RPM, affecting the submarine's forward movement.
  2. Fluid Mechanics:

    • Simulates real-world water resistance, buoyancy, and drag forces acting on the submarine.
    • Water density and gravity are configurable parameters that impact the submarine's motion.
  3. Collision Detection:

    • A sophisticated collision system prevents the submarine from moving through the sea floor or other objects. The system calculates corrective forces, slowing the submarine before impact.
  4. Realistic Ocean Rendering:

    • The ocean surface and underwater environments simulate real-world lighting and refraction effects, including changing skyboxes for different times of day (dawn, noon, sunset).

Screenshots ๐Ÿ“ธ

Screenshot 2 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8 Screenshot 9 Screenshot 10 Screenshot 11 Screenshot 12

Demo Walkthrough ๐Ÿš€

The demo allows users to interact with two different submarine models and experience various controls:

  1. Models: Navigate both the Typhoon and Ohio class submarines.
  2. Controls:
    • Adjust depth, speed, rudders, and engine power.
    • Experience changes in submarine physics based on adjustments to ballast tanks and propeller speed.
  3. Environment Interaction:
    • The simulation features day-night cycles, water reflection, and refraction effects.
    • Switch between surface and underwater views.
  4. Real-time Physics Display: View detailed data on submarine dynamics in a side panel (speed, angle, depth).

For more detailed information, please refer to the project report attached in this repository.

Technical Specifications โš™๏ธ

  • Frontend: Developed using Three.js for real-time 3D rendering. ๐Ÿ–ผ๏ธ
  • Bundler: Vite provides fast and efficient build processes. โšก
  • Docker Integration: Supports Docker for easy containerized deployment. ๐Ÿณ

Getting Started ๐Ÿ› ๏ธ

Prerequisites

  • Node.js: Make sure Node.js is installed.
  • Docker (Optional): Recommended for consistent environment setup.

Installation

  1. Clone the Repository:

    git clone https://github.com/your-username/submarine-simulation-system.git
  2. Navigate to the Project Directory:

    cd submarine-simulation-system
  3. Install Dependencies:

    npm install
  4. Run Locally:

    npm run dev

    Open the application at http://localhost:8084/.

Build for Production

To create an optimized production build:

npm run build

Docker Setup (Optional)

Run the project using Docker for a containerized environment:

docker build -t your-custom-image-name .
docker run -p 8084:8084 your-custom-image-name

Documentation ๐Ÿ“š

A documentation website has been created for this project, detailing the code structure and usage. Access it here.

Live Demo ๐ŸŒ

The project is also deployed and accessible online at https://submarine-simulation-system.vercel.app/.

Report ๐Ÿ“„

The full project report is available here. It includes detailed information about the physics, hydrodynamics, and technical design of the submarine simulation system.

Integration of Open Source Work ๐ŸŒ

The environment and ocean rendering in this project were adapted from the open-source Three.js Ocean Scene by Nugget8. Special thanks to the original author for providing this fantastic resource.

Contributing ๐Ÿค

We welcome contributions! Hereโ€™s how you can contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

License ๐Ÿ“œ

This project is licensed under the MIT License.