Skip to content

Instantly share code, notes, and snippets.


Greg Borenstein atduskgreg

View GitHub Profile
atduskgreg / rotation_around_a_point.pde
Created Dec 24, 2011
Controlling the center of rotation in Processing
View rotation_around_a_point.pde
// Rotation Around a Point
// ***********************
// To acheive rotation around a given point
// - translate to that point
// - rotate
// - then translate back
// (note: in Processing this last step is implicit
// since draw() resets all transformations
// each time it runs.)
atduskgreg / arduino_firmware.cpp
Created Nov 8, 2011
send multiple values over serial from Processing to Arduino
View arduino_firmware.cpp
int currentValue = 0;
int values[] = {0,0};
void setup() {
void loop() {
atduskgreg / gist:1165900
Created Aug 23, 2011
View gist:1165900
import processing.opengl.*;
import SimpleOpenNI.*;
SimpleOpenNI kinect;
int[] sceneMap;
void setup() {
size(640, 480, OPENGL);
kinect = new SimpleOpenNI(this);
View gist:46e6b51c0d45faa6c561

An Example of Play

To further clarify what really goes on during an AD&D game, read the following example. This is typical of the sort of action that occurs during a playing session. Shortly before this example begins, three player characters fought a skirmish with a wererat (a creature similar to a werewolf but which becomes an enormous rat instead of a wolf). The wererat was wounded and fled down a tunnel. The characters are in pursuit. The group includes two fighters and a cleric.

Fighter 1 is the group's leader.

View animals.txt
Guinea pig
View main.js
const ApeECS = require('ape-ecs');
class Position extends ApeECS.Component {
this.x = 0;
this.y = 0;
View UDPPacketIO.cs
using System;
using System.IO//.Ports;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using UnityEngine;
/// <summary>
/// UdpPacket provides packetIO over UDP
atduskgreg /
Last active Sep 24, 2020
Art and Science of Illusion Notes
atduskgreg / PWindow.pde
Last active Sep 21, 2020
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
View PWindow.pde
class PWindow extends PApplet {
PWindow() {
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
void settings() {
size(500, 200);
atduskgreg / photomosaic.pde
Created Jan 13, 2013
Processing tool to create a photomosaic from a directory of images. Thoroughly commented as part of a tutorial for @mathpunk.
View photomosaic.pde
// Create photomosaics from a source image and a directory of tile images.
// by Greg Borenstein, January 2013
// Read more here:
// see inline comments for more details
// -------------------------------------
// Import the java libraries we need.
// These are both utilites for sorting things.
You can’t perform that action at this time.