Skip to content

Instantly share code, notes, and snippets.

View haschdl's full-sized avatar

Half Scheidl haschdl

View GitHub Profile
# example on how to save Processing sketch in Python mode
# copy and paste to your sketch
from datetime import datetime
def keyPressed():
if key == 'S' or key == 's':
saveSketch()
# example on how to save Processing sketch in Python mode
@haschdl
haschdl / 2019-projects.md
Created December 30, 2018 11:11
2019 Possible applications?
@haschdl
haschdl / Save.pde
Last active December 10, 2021 22:49
[Processing] A reusable "save" command, with basic and advanced modes (copy and paste into new tab in Processing)
/*
* Function for saving the generated image into a file when you press "S" or "B" key.
* Files will be saved to /out folder, with name: [Sketch name]_[Timestamp].jpg
*
* It works in two ways:
* 1. S key (BASIC)
* If you press the S key ("Save"), it will save the contents of the screen.
* The image is saved in the same resolution as your sketch size. In other words,
* the image will have the same size as "height" by "width" pixels.
*
@haschdl
haschdl / basic_voronoi
Created July 26, 2018 09:56
[ShaderToy] Basic Voronoi
/*
* Voronoi visualization
* Copy of the first approach by @The_ArtOfCode, shown at https://www.youtube.com/watch?v=l-07BXzNdPw
*
* 27.07.2018
*/
vec2 N22(vec2 p) {
vec3 a = fract(p.xyx*vec3(123.34,234.34,345.65));
a += dot(a, a+34.45);
return fract(vec2(a.x*a.y, a.y * a.z));
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
@haschdl
haschdl / OpenSimplexNoise.java
Created July 23, 2018 20:30 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of