https://github.com/erkaman/cloud_gen
Procedural Generation of Clouds with Vector Graphics
https://github.com/erkaman/cloud_gen
bezier bezier-curves c-plus-plus cloud demo ellipse procedural procedural-generation svg vector-graphics
Last synced: about 1 month ago
JSON representation
Procedural Generation of Clouds with Vector Graphics
- Host: GitHub
- URL: https://github.com/erkaman/cloud_gen
- Owner: Erkaman
- License: mit
- Created: 2016-12-27T14:55:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-08T10:30:25.000Z (over 8 years ago)
- Last Synced: 2025-04-06T23:14:23.999Z (about 2 months ago)
- Topics: bezier, bezier-curves, c-plus-plus, cloud, demo, ellipse, procedural, procedural-generation, svg, vector-graphics
- Language: C++
- Size: 667 KB
- Stars: 51
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Procedural Generation of Clouds with Vector Graphics.
This is just a quick experiment where I tried generating procedural
2D clouds using vector graphics. The experiment is just a program that
outputs a bunch of vector clouds as a SVG file:
You can see the SVG files in the directory `img/`.
## Building and Usage
You can build using make:
```
make
```You can now generate an SVG with clouds by doing
```
./cloud_gen > out.svg
```By changing the variable
```
int TYPE = 0;
```in `main.cpp` you can generate different kinds of clouds.
## How Does this Work?
We start with the geometry for an ellipse:
Then we replace every edge on the original ellipse with a cubic Bezier curve:
To introduce some randomness, we randomly move the control points of
the cubic bezier curves some:
and that's it!