Skip to content

Instantly share code, notes, and snippets.

Avatar

Greg Borenstein atduskgreg

View GitHub Profile
@atduskgreg
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
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() {
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
@atduskgreg
atduskgreg / gist:1165900
Created Aug 23, 2011
simple_openni_scenemap.pde
View gist:1165900
import processing.opengl.*;
import SimpleOpenNI.*;
SimpleOpenNI kinect;
int[] sceneMap;
void setup() {
size(640, 480, OPENGL);
kinect = new SimpleOpenNI(this);
kinect.enableDepth();
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
Canidae
Felidae
Cat
Cattle
Dog
Donkey
Goat
Guinea pig
Horse
Pig
View main.js
const ApeECS = require('ape-ecs');
class Position extends ApeECS.Component {
constructor(){
super();
this.x = 0;
this.y = 0;
}
init(values)
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
atduskgreg / illusion.md
Last active Sep 24, 2020
Art and Science of Illusion Notes
View illusion.md
@atduskgreg
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() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
@atduskgreg
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.