Skip to content

Instantly share code, notes, and snippets.

View gwygonik's full-sized avatar

g.wygonik gwygonik

View GitHub Profile
@gwygonik
gwygonik / SquiggleDraw.pde
Created November 22, 2016 04:25
Create an SVG based on the brightness of an image transformed into sine waves. Simple UI to control effects. Saved SVG is larger than original image for detail.
import controlP5.*;
import processing.svg.*;
ControlP5 gui;
PShape s;
PShape liner;
PImage p1;
PImage p2;
@gwygonik
gwygonik / L3DCubeAccelerometerDemo.ino
Last active August 29, 2015 14:12
A demo of using the accelerometer in the L3D Cube to keep a "ground plane" level while rotating side to side. Two color modes - ground and water. You'll need to add the Adafruit Neopixel library to your code in Spark.
// This #include statement was automatically added by the Spark IDE.
#include "neopixel/neopixel.h"
#include <math.h>
//set up the pin that controls the LEDs, the type of LEDs (WS2812B) and the number of LEDs in the cube (8*8*8=512)
#define PIXEL_PIN D0
#define PIXEL_COUNT 512
#define PIXEL_TYPE WS2812B
#define SIDE 8
//accelerometer pinout
@gwygonik
gwygonik / PerceptibleCircles.pde
Created September 4, 2013 14:09
Processing sketch to redraw an image with circles that are sized according to the surrounding colors (perceptible-similar via CIE76)
PImage imgOriginal, imgNew;
color c;
int maxVar = 30; // this is how close the colors need to be for circle expansion. Lower number = closer in color
int step = 2; // smallest circle/step size
int circleResolution = 90; // every 90-degrees... less degrees = more expansion = more time to draw
int x=0,y=0;
boolean isRunning = true;
@gwygonik
gwygonik / CircleImage.pde
Last active December 22, 2015 03:59
Basic exponentially reducing circle image processing for Processing
PImage imgOriginal, imgNew;
color c;
void setup() {
imgOriginal = loadImage("IMG_6319.jpg"); // load image here
hint(DISABLE_DEPTH_TEST);
blendMode(MULTIPLY);
imgNew = new PImage(1200,600);
imgNew.copy(imgOriginal,0,0,imgOriginal.width,imgOriginal.height,0,0,1200,600); // stretch original image to size
@gwygonik
gwygonik / VoronoiImageTread.pde
Created July 22, 2013 14:23
Voronoi Tread Image - Processing script that drives across the middle of an image, sampling colors and displaying data
import toxi.geom.*;
import toxi.geom.mesh2d.*;
import toxi.util.*;
import toxi.util.datatypes.*;
import toxi.processing.*;
Voronoi vo = new Voronoi();
ToxiclibsSupport gfx;
PImage cm = new PImage(1280,720);
@gwygonik
gwygonik / HueTube.es
Last active December 17, 2015 00:29
SynthScript (for Anandamide Variant)
// HueTube
// for Structure Synth - Anandamide variant (http://anandamidelogistics.com/)
set translation [-0.602337 0.326383 -20]
set rotation [-0.853031 -0.515111 -0.0834604 -0.518933 0.85418 0.0319882 0.0548153 0.0706038 -0.995965]
set pivot [0 0 0]
set scale 1.02
set background #000
set maxdepth 400
@gwygonik
gwygonik / candleholder.es
Created May 3, 2013 14:22
Collapsing New Candleholder - a StructureSynth script
// settings
set translation [-0.490422 2.32762 -20]
set rotation [-0.00235658 -0.0112162 0.999936 -0.906447 0.422316 0.00260091 -0.422318 -0.906383 -0.0111623]
set pivot [0 0 0]
set scale 0.108795
set background #fff
set maxdepth 10