https://github.com/kennfatt/snowflakes
Graphic rendering using Piston and Glutin written in pure Rust
https://github.com/kennfatt/snowflakes
2d-graphics gl graphics rust
Last synced: about 1 year ago
JSON representation
Graphic rendering using Piston and Glutin written in pure Rust
- Host: GitHub
- URL: https://github.com/kennfatt/snowflakes
- Owner: KennFatt
- License: mit
- Created: 2020-07-31T06:53:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T09:13:19.000Z (about 5 years ago)
- Last Synced: 2025-01-01T22:11:31.106Z (over 1 year ago)
- Topics: 2d-graphics, gl, graphics, rust
- Language: Rust
- Homepage:
- Size: 3.25 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snowflakes

This project is part of my boredum in quarantine, so I have to learn something new (Rust language) and then implement it with something fun!
Ikr, _nothing fancy_ here. My first attempt with Rust tho.
## How to
**build**
```
cargo build --release
```
**run**
```
cargo run --release
```
_Considering to use release mode._
### Notes
If somebody or myself in the future wondering why I wrote this code:
```rust
pub struct Snowflakes {
capacity: usize,
radius: Vec,
velocity: Vec,
x: Vec,
y: Vec,
}
pub struct Snowflake {
pub id: usize,
pub radius: f64,
pub velocity: f64,
pub x: f64,
pub y: f64,
}
```
here is my explanation, first the struct `Snowflakes` is implement the SoA pattern. I'm not sure if it will perform well on heap allocation (those vectors). I want to use something like [FixedSizeArray](https://doc.rust-lang.org/beta/core/array/trait.FixedSizeArray.html) in the future if it's finally arrive as the stable features.
Lastly, the struct `Snowflake` is just a template for me to manipulate the data that I got from `Snowflakes` to more specific.