Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msurguy/triangles
Delaunay triangulation + Lambertian reflectance
https://github.com/msurguy/triangles
Last synced: 3 days ago
JSON representation
Delaunay triangulation + Lambertian reflectance
- Host: GitHub
- URL: https://github.com/msurguy/triangles
- Owner: msurguy
- License: other
- Created: 2014-04-11T23:14:17.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-03-22T21:43:34.000Z (almost 7 years ago)
- Last Synced: 2025-02-08T15:08:18.078Z (10 days ago)
- Language: JavaScript
- Homepage: https://msurguy.github.io/triangles/
- Size: 10.4 MB
- Stars: 719
- Watchers: 33
- Forks: 80
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Delaunay Triangulation pattern maker
This project allows you to create beautiful high quality images featuring a nice pattern created from Delaunay triangulation and applying a flat surface shader. These images could be used for:
- Wallpapers
- Blog post headers
- Magazines
- Posters
- And moreThe tool provides export to PNG and SVG formats. With SVG format you could create an image of virtually any size, even as big as a billboard. Go crazy with it!
## Show me some results!
Here are a few of most obvious uses for the tool:


And I made a video on Youtube of the tool in action, creating 11 wallpapers in under 7 minutes:
[](http://www.youtube.com/watch?v=JbD-HsmBt_0)You can also see some examples of the patterns made with this tool in this repository in the examples folder (the first one had text overlay added in Photoshop):







## Using
- To add a new light press Enter key on your keyboard or increase count manually via the slider.
- To "drop" or "pick up" the currently selected light, press Space bar.
- To change colors of the lights, change the ambient and diffuse color controls.
- To export as SVG select SVG in the "renderer" panel and then export the image via "Export big" button. Then navigate to "File -> Save as" in the browser's menu to save the resulting image to your computer.## Running
Download this repository and run index.html in your browser or open [this link](http://msurguy.github.com/triangles/).
## Building
Install Dependencies:
npm install [email protected]
Build (cd into 'build' folder first):
node build.js
## Inspiration
The iOS game called "[Monument Valley][monument]" by [ustwo][ustwo] served as an inspiration for this project. Specifically the simulation of the ocean in the game.
## Acknowledgments
The shader work was done by Matthew Wagerfield on his MIT-licensed [repository][repository].
## Author
Maksim Surguy [@msurguy][msurguy]
## TODO
There are a few things that can be improved to make this tool even better.
- ~~Add varying depth of the vertices of the triangles~~ (Done as of 4/15/2014)
- ~~Add more color variation and presets~~ (Done as of 4/25/2014 with the randomizer functionality)
- Add text overlay and customizer for textIf you can do any of these things - feel free to make a pull request!
## License
Licensed under [MIT][mit]. Enjoy.
[repository]: https://github.com/wagerfield/flat-surface-shader
[msurguy]: http://twitter.com/msurguy
[mit]: http://www.opensource.org/licenses/mit-license.php
[monument]: http://www.monumentvalleygame.com/
[ustwo]: http://ustwo.com/