Skip to content

Instantly share code, notes, and snippets.

View mfwhitman's full-sized avatar

Michael Whitman mfwhitman

  • Brisbane, Australia
View GitHub Profile
@mfwhitman
mfwhitman / ConwaysTenorion.pde
Last active August 29, 2015 13:57
A Tenori-on that plays Conway's Game of Life.
import ddf.minim.*;
import ddf.minim.signals.*;
Minim minim;
AudioOutput out;
Cell[][] field;
int timeElapsed, frameSum, beatStage;
boolean isPaused;
@mfwhitman
mfwhitman / UdaConvolution.cu
Created March 9, 2014 05:43
An answer to Udacity CS344 Homework assignment no. 2: Image Blurring. No optimization yet.
// Homework 2
// Image Blurring
//
// In this homework we are blurring an image. To do this, imagine that we have
// a square array of weight values. For each pixel in the image, imagine that we
// overlay this square array of weights on top of the image such that the center
// of the weight array is aligned with the current pixel. To compute a blurred
// pixel value, we multiply each pair of numbers that line up. In other words, we
// multiply each weight with the pixel underneath it. Finally, we add up all of the
// multiplied numbers and assign that value to our output for the current pixel.
@mfwhitman
mfwhitman / UdaToneMap.cu
Last active August 29, 2015 13:57
An answer to Udacity CS344 Homework assignment no. 3: Tone Mapping.
/* Udacity Homework 3
HDR Tone-mapping
Background HDR
==============
A High Definition Range (HDR) image contains a wider variation of intensity
and color than is allowed by the RGB format with 1 byte per channel that we
have used in the previous assignment.
@mfwhitman
mfwhitman / BallTrigSack.pde
Last active August 29, 2015 13:56
This gist tests some basic cannon-firing, missile-shooty trigonometry. It also produces a nice pretty pattern.
int maxBalls = 100;
Ball[] ManyBalls = new Ball[maxBalls];
int ballcount = 0;
void setup()
{
size(640,640);
fill(125);
colorMode(HSB, 360, 100, 100);
background(color(180, 10, 45));
@mfwhitman
mfwhitman / testXOR.pde
Created February 16, 2014 03:48
Draws a table of x XOR y, converted to greyscale values.
int[][] xorTable;
Boolean drawOnce = false;
int rectSize = 10;
int bits = 64;
void setup(){
xorTable = new int[bits][bits];
size(bits * rectSize, bits * rectSize);
colorMode(RGB, bits);
noStroke();
@mfwhitman
mfwhitman / DottedLine.pde
Last active August 29, 2015 13:55
Creates a animated dotted line.
int shutter = 0;
int changeover = 0;
float[] interx;
float[] intery;
int headx = 20;
int heady = 20;
int tailx = 460;
int taily = 460;