In this repository you can find:
- Programs written for the Fun Programming video tutorials: fun-programming
- My creative coding experiments: processing/ideas. These are not finished work but tests I do while developing a project or experiments done just for fun and out of curiosity. Index below. You can view some results at https://hamoid.com and at http://hamoid.tumblr.com/archive
Most programs here are written using Processing. Some with SuperCollider. They are great for creating static / animated / interactive graphics and sound synthesis.
My current tools include OPENRNDR and GLSL.








!["Spirograph", "String art" or "pin and thread art"?  Rotate two points around the center at different speeds. Connect the two points with a line of varying color.  ``` mouse click = restart hold [space] for fade out [s] to save  ```](/hamoid/Fun-Programming/raw/master/processing/ideas/2011/10/sinecosine2/.thumb.jpg)










](/hamoid/Fun-Programming/raw/master/processing/ideas/2013/02/ColorJoy/.thumb.jpg)

.](/hamoid/Fun-Programming/raw/master/processing/ideas/2013/02/RotationContinuity/.thumb.jpg)






![``` Loads random images from two folders (please configure) to act as textures for painting strokes. The brush size modulates with time.  How I use it: I paint a stroke, if I don't like it, press 'u' to undo, try again. Get into the rhythm. Wait until the stroke paints thin or thick. Observe. Press [SPACE] to change paint colors. Embrace the unpredictable.  Key shortcuts: [DELETE] clears the screen 's'      saves image in TIF format 'u'      undo last stroke [SPACE]  load new random images  Mouse Left mouse button drag to paint a stroke Light mouse button drag to paint darker ```](/hamoid/Fun-Programming/raw/master/processing/ideas/2013/11/imageDistortsImage/.thumb.jpg)





























![This program uses two libraries: Peasycam and https://github.com/nervoussystem/OBJExport  Usage:  - Click and drag the mouse to rotate the camera. Mousewheel to zoom it/out. - Press [space] to save the current camera orientation to a file called `camera.ser`. This file will be loaded when starting the program again. - Press [e] to export `boxesAreLight.obj` to disk - Press [r] to randomize the shape - Press [s] to save the view to `thumb.jpg`  The program in action:   The exported .obj file rendered with Blender](/hamoid/Fun-Programming/raw/master/processing/ideas/2015/01/boxesAreLight/.thumb.jpg)










![Draws an animated loop of an aggresive generative tree.  Not meant for real time consumption but for producing an animated GIF file.  The [space] key randomizes the seed to produce different looking trees.](/hamoid/Fun-Programming/raw/master/processing/ideas/2015/06/recursiveTree/.thumb.jpg)


![Draws closed shapes by passing the points of a circle through the `noise()` function.  That value is used as the variable radius of circular shape. The radius decreases over time, so we can draw smaller and smaller shapes as time passes, with the goal of covering the screen, first with large shapes and at the end very small ones.  The colors are read from random photographs found in a folder.  Press `z` during the drawing to blur previous shapes, `[space]` to load a new image for color sampling.](/hamoid/Fun-Programming/raw/master/processing/ideas/2015/06/theLookOfNoiseFlat/.thumb.jpg)
![Draw a grid by drawing a set of vertical and horizontal lines. Those lines are distorted by using noise. The lines are actually drawn with blend mode ADD in 3 passes, one for red, one for green and one for blue. Each of those passes is slightly offset in the noise space, producing chromatic aberration.  A black and white image is generated with the word "we". Later the pixels of that image are sampled to decide how bright the R, G and B colors should be, making the word appear in the rendered grid.  Press the `[space]` key to try again with a different seed.](/hamoid/Fun-Programming/raw/master/processing/ideas/2015/06/we/.thumb.jpg)


![Program that draws glowing curves quantized to 6 possible angles, producing hexagonal shapes.  Mouse click to set the center of rotation.  [space] to clear  's' to save](/hamoid/Fun-Programming/raw/master/processing/ideas/2015/09/radial_hex/.thumb.jpg)











![A sketch that draws a huge number of lines of various lengths and colors all starting from the same position is space.  Press [space] to trigger a render, [s] to save the resulting image.  These images were all created with this program by slightly changing the formula.](/hamoid/Fun-Programming/raw/master/processing/ideas/2017/05/plot3Dorganic/.thumb.jpg)



](/hamoid/Fun-Programming/raw/master/processing/ideas/2017/10/copycat_gears/.thumb.jpg)









![A confusing program doing a lot of stuff :) To start press `[space]`.  There's video playing as a source of texture. It uses noise to draw that texture in symmetrical "butterfly like" shapes.  It uses a flow-style shader to smear the result based on hue.  Then the whole result is partially occluded and seen only through a mask full of words. That mask is loaded from disk, but there's an alternative one generated in real time (commented out). The mask scrolls up as the credits of a movie.  The `[enter]` key jumps to a random location in the movie and randomizes noise seed.  The `s` key is used for starting and ending video export. It calls a command line voice synthesizer to speak `start` and `stop`.](/hamoid/Fun-Programming/raw/master/processing/ideas/2018/02/shaderScrollTextured/.thumb.jpg)






![Creates a cloud of cuboids positioned and scaled using `noise()`. The cuboids are shaded with a shader that produces stripes along one axis. The axis is specified as a integer `uniform` between 0 and 2 for each drawn cuboid. You can access a component of a vec3 in a shader by its index, so `pos[0] = pos.x`, `pos[1] = pos.y` and `pos[2] = pos.z`.  Hold down the mouse button to see the effect of `OPTIMIZED_STROKE`. For me the default state of that property in Processing is not the expected one, as `OPTIMIZED_STROKE` produces unwanted side effects when using vertex shaders. If something is not working with your vertex shader I suggest toggling that variable to `ENABLED` and `DISABLED` to see if it has an effect.](/hamoid/Fun-Programming/raw/master/processing/ideas/2018/04/orthocubes/.thumb.jpg)
, [two](https://twitter.com/hamoid/status/999405228729528320).](/hamoid/Fun-Programming/raw/master/processing/ideas/2018/05/linesFlying/.thumb.jpg)









 and [two](https://www.openprocessing.org/sketch/675134)  And a version in [OPENRNDR](https://github.com/hamoid/openrndr-template/blob/master/src/main/kotlin/p5/p07_lineNormals.kt)](/hamoid/Fun-Programming/raw/master/processing/ideas/2018/11/lineNormals/.thumb.jpg)



](/hamoid/Fun-Programming/raw/master/processing/ideas/2019/01/clickToErase/.thumb.jpg)
 when porting this program to OPENRNDR.](/hamoid/Fun-Programming/raw/master/processing/ideas/2019/04/circularGradients/.thumb.jpg)




. Uses 3 point lights to create color gradients. Uses an exponential distribution so there are few large shapes and many small ones.](/hamoid/Fun-Programming/raw/master/processing/ideas/2019/06/crosses/.thumb.jpg)

![A mildly interactive sketch. The mouseX position sets the length of the drawn lines. [space] clears the background.  Lines are drawn starting on a circle, the exact point advancing clockwise. For each line it searches for 3 other nearby points at 3 different distances. It does that by first checking the pixel color on a photo at the spawn location. Then it searches three concentric circles in that photo for the most similar color in that virtual circle.  The spawn point and the 3 found points for the basis for a bezier curve. Instead of drawing that bezier curve directly, it interpolates smoothly towards that bezier curve. It does so to avoid jitter and reduce random jumps.  By coming up with different algorithms for moving the spawn point one can produce different aesthetics.](/hamoid/Fun-Programming/raw/master/processing/ideas/2019/09/bezier_similarity/.thumb.jpg)






