This project implements a WebGL fluid simulation using a variety of modern web technologies, including React, Three.js, and various supporting libraries. The goal is to create an interactive and visually appealing fluid simulation that can run efficiently in a web browser.
To get started with the project, you need to have Node.js and npm installed. Then, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/webgl-fluid-simulation.git cd webgl-fluid-simulation
-
Install the dependencies:
npm install
To run the project locally, use the following command:
npm start
This will start the development server and open the application in your default web browser. The application will automatically reload if you make changes to the code.
The project structure is organized as follows:
webgl-fluid-simulation/
├── public/
│ ├── index.html
│ └── ...
├── src/
│ ├── components/
│ │ ├── FluidCanvas.js
│ │ └── ...
│ ├── App.js
│ ├── index.js
│ └── ...
├── .gitignore
├── package.json
├── README.md
└── ...
- public/: Contains the public assets and the main HTML file.
- src/: Contains the source code of the application.
- components/: Contains the React components used in the application.
- App.js: The main application component.
- index.js: The entry point of the application.
This project uses the following technologies:
- React: A JavaScript library for building user interfaces.
- Three.js: A 3D library that makes WebGL simpler.
- @react-three/fiber: A React renderer for Three.js.
- fluid-canvas: A library for creating fluid simulations on a canvas.
- fluid-simulation-react: A React component for fluid simulation.
- webgl-fluid: A WebGL-based fluid simulation library.
- @babel/runtime: Babel's modular runtime helpers.
- @emotion/react and @emotion/styled: Libraries for writing CSS styles with JavaScript.
- @mui/material: Material-UI, a popular React UI framework.
- typescript: A typed superset of JavaScript that compiles to plain JavaScript.
- Interactive Fluid Simulation: Users can interact with the fluid simulation using mouse or touch inputs.
- Real-time Rendering: The simulation runs in real-time, providing a smooth and responsive experience.
- Modern UI: Built with React and Material-UI for a modern and responsive interface.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for checking out the WebGL Fluid Simulation project! If you have any questions or feedback, feel free to reach out.