An open API service indexing awesome lists of open source software.

https://github.com/takana671/fluidcube

Particle Movement Using Curl Noise
https://github.com/takana671/fluidcube

curl-noise cython numpy panda3d python

Last synced: 1 day ago
JSON representation

Particle Movement Using Curl Noise

Awesome Lists containing this project

README

          

# FluidCube

In this repository, I experimented with how particles move when their positions are updated using curl noise.
Run `fluid_cube.py` and press the [M] key to start the particle movement.
Once all particles have disappeared, the [M] key can be pressed again. Each time pressing the key, the values of the `noise_scale` and `flow_strength` parameters are automatically set to random numbers, causing the particles to move differently.
The current values are displayed in the console.
The meanings of each parameter are as follows:

#### *noise_scale*
The larger the noise_scale, the greater the particle motion.

#### *flow_strength*
The magnitude of the force generated by the vector field.
The larger the value, the faster the particle moves.

https://github.com/user-attachments/assets/a60178c1-1692-4396-a494-d25702e655aa

# Requirements

* Cython 3.2.3
* numpy 2.2.6
* Panda3D 1.10.16

# Environment

* Python 3.13
* Windows11

# Usage

### Clone this repository.
```
git clone --recursive https://github.com/taKana671/FluidCube.git
```

### Build cython code.
```
cd FluidCube
python setup.py build_ext --inplace
```
If the error like "ModuleNotFoundError: No module named ‘distutils’" occurs, install the setuptools.
```
pip install setuptools
```

### Run fluid_cube.py
```
python fluid_cube.py
```