Skip to content

Instantly share code, notes, and snippets.

View zeffii's full-sized avatar

Dealga McArdle zeffii

View GitHub Profile
@zeffii
zeffii / colourPicker.pde
Created December 12, 2011 20:06
colourPicker class for Processing (not mine)
class ColorPicker{
int x, y, w, h, c;
PGraphics pg;
PImage cpImage;
ColorPicker ( int x, int y, int w, int h, int c ){
this.x = x + 20;
this.y = y + 20;
this.w = w;
@zeffii
zeffii / sendingGmail.py
Created December 13, 2011 14:14
sends to gmail account.
# by Rodrigo R. Guimaraes
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import encoders
import os
gmail_user = "[email protected]" # Change this email for you gmail
@zeffii
zeffii / LIGGGHTS_PARSING.py
Created December 13, 2011 16:00
LIGGGGHTS parser for blender
import bpy
import time
from mathutils import Vector
# purposely coded verbosely in places. relax :)
'''
about the data being processed here:
we have 11 elements per line. Per particle snapshot they inform us about:
Element[0] = track num
Element[1] = timestamp = num * 0.35ms (from the start)
@zeffii
zeffii / simple_circle.pde
Created December 23, 2011 17:35
hand drawing ellipse
float _x;
float _y;
float _rad;
void setup(){
size(400,400);
noLoop();
smooth();
_rad = 160.0;
@zeffii
zeffii / radial gradiant.pde
Created December 25, 2011 19:49
small elaboration using sin and cos.
float _x;
float _y;
float _rad;
void setup(){
background(0);
size(400,400);
noLoop();
smooth();
_rad = 30.0;
@zeffii
zeffii / fasterGradient.pde
Created December 25, 2011 22:06
faster than pixel drawing
float _x;
float _y;
float _rad;
void setup(){
background(0);
size(600,600);
noLoop();
smooth();
_rad = 30.0;
@zeffii
zeffii / direction button class.pde
Created December 26, 2011 21:29
Processing UI button AntiPattern
Button cb1, cb2, cb3, cb4;
void setup(){
size(600,600);
frameRate(24);
cb1 = new Button(new PVector(0,0), "UP");
cb2 = new Button(new PVector(30,0), "DOWN");
cb3 = new Button(new PVector(60,0), "LEFT");
cb4 = new Button(new PVector(90,0), "RIGHT");
Button cb1, cb2, cb3, cb4;
void setup(){
size(600,600);
// frameRate(24);
smooth();
cb1 = new Button(new PVector(0,0), "UP");
cb2 = new Button(new PVector(30,0), "DOWN");
cb3 = new Button(new PVector(60,0), "LEFT");
@zeffii
zeffii / mouseOverButton.pde
Created December 28, 2011 20:48
small elaboration adding mouseOver
Button cb1, cb2, cb3, cb4;
void setup(){
size(600,600);
frameRate(24);
smooth();
cb1 = new Button(new PVector(0,0), "UP");
cb2 = new Button(new PVector(30,0), "DOWN");
cb3 = new Button(new PVector(60,0), "LEFT");
@zeffii
zeffii / VectorFieldv1.pde
Created December 31, 2011 13:07
Vector Field basic.
int APP_WIDTH;
int APP_HEIGHT;
ArrayList<VectorPointer> vectors;
void setup() {
APP_WIDTH = 640;
APP_HEIGHT = 360;
size(APP_WIDTH, APP_HEIGHT);
frameRate(24);