Skip to content

Instantly share code, notes, and snippets.

@darkwave
darkwave / Game.pde
Created August 3, 2014 09:47
Prototype for a game engine based on JSON and Reflection using Processing
import java.lang.reflect.*;
import java.util.Map;
import java.util.Map.Entry;
int availableIndex = 0;
int generateID() {
return availableIndex++;
}
@darkwave
darkwave / ElementalHttpServer.java
Last active August 29, 2015 14:05
Scratch Helper using Processing prototype
import java.io.File;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.security.KeyStore;
import java.util.Locale;
@darkwave
darkwave / EsempioElement.pde
Created October 11, 2014 10:14
Esempio Element
import remixlab.proscene.*;
Scene scene;
Element elemento1, elemento2, elemento3;
void setup() {
size(displayWidth, displayHeight, P3D);
scene = new Scene(this);
elemento1 = new Element(0, 0, 0);
elemento2 = new Element(100, 0, 0);
elemento3 = new Element(0, 0, 100);
@darkwave
darkwave / Libreria3D.pde
Last active August 29, 2015 14:08
Simple 3D engine under GPL v3
import remixlab.proscene.*;
import remixlab.dandelion.geom.Quat;
import remixlab.dandelion.core.InteractiveFrame;
import remixlab.dandelion.geom.Vec;
HashMap<String, PShape> cachedShapes = new HashMap<String, PShape>();
class Game extends Scene {
boolean keyboardEnabled = true;
@darkwave
darkwave / EdiacaraBiota.pde
Last active August 29, 2015 14:08
IndieVault Jam prototype
import fisica.*;
FWorld world;
FPoly poly;
PShape level;
FPoly target;
PImage splash;
float angle = 0;
boolean go, goLeft, goRight, started;
@darkwave
darkwave / EsempioVariabili.pde
Created November 20, 2014 21:45
Snippet Lezione 3 al Fusolab 2.0
int numero;
int numeroB = 2;
float numeroCasuale = random(10);
numero = 10 + numeroB;
char lettera = 'a';
String testo = "qualcosa di esempio";
float numeroDecimale = 0.1;
int diametro = 20;
ellipse(50, 50, diametro, diametro);
@darkwave
darkwave / AndroidDataReceiver.pde
Last active April 7, 2023 12:03
How to receive Android Intent data from another App using Processing
/*
For more information visit Android developer portal http://developer.android.com/training/sharing/receive.html
*/
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
import java.io.InputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import android.content.Intent;
@darkwave
darkwave / QRCodeTest.pde
Created November 24, 2014 18:56
QRCode reader using ZXing with Processing 3.0a5
import processing.video.*;
import com.google.zxing.*;
import java.io.ByteArrayInputStream;
import javax.imageio.ImageIO;
import com.google.zxing.common.*;
import com.google.zxing.client.j2se.*;
import java.awt.image.BufferedImage;
Capture cam; //Set up the camera
@darkwave
darkwave / QRCodeAndroidTest.pde
Created November 25, 2014 10:55
QRCode reader using ZXing with Processing under Android (Ketai)
import com.google.zxing.*;
import java.io.ByteArrayInputStream;
import javax.imageio.ImageIO;
import com.google.zxing.common.*;
import com.google.zxing.client.j2se.*;
import android.graphics.Bitmap;
import ketai.camera.*;
KetaiCamera cam;
boolean globalHistogram = false;
@darkwave
darkwave / Orologio.pde
Last active August 29, 2015 14:10
Esempio orologio versione 1
/**
Un orologio in Processing
Immagini di riferimento:
http://tinyurl.com/fusi004a
http://tinyurl.com/fusi004b
**/
PImage quadrante = null;
PImage lancetta = null;