Skip to content

Instantly share code, notes, and snippets.

@tado
tado / ParticleVec3.pde
Last active February 26, 2016 07:37
3D Particle for Processing
int NUM = 2000;
ParticleVec3[] particles = new ParticleVec3[NUM];
void setup() {
size(1280, 720, P3D);
frameRate(60);
for (int i = 0; i < NUM; i++) {
particles[i] = new ParticleVec3();
particles[i].radius = 4.0;
particles[i].position.set(random(width), random(height), random(height));
@tado
tado / index.html
Created May 13, 2015 23:34
HTML templete
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTMLのテンプレート</title>
</head>
<body>
<h1>HTMLテンプレート</h1>
<p>HTMLのテンプレートです。</p>
</body>
@tado
tado / ofApp.cpp
Created May 24, 2015 09:56
ofxCv Contour Finder with ofxKinect
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
//画面設定
ofSetFrameRate(60);
ofBackground(0);
// Kinect初期化
kinect.init();
kinect.open();
@tado
tado / drawer.pde
Last active August 29, 2015 14:21
Drawing photo for processing
PImage img;
void setup() {
size(800, 600);
img = loadImage("photo.jpg");
image(img, 0, 0, width, height);
loadPixels();
background(0);
}
void draw() {
noStroke();
@tado
tado / ofApp.cpp
Created June 1, 2015 16:25
ofxCv CounourFinder get center points
#include "ofApp.h"
using namespace ofxCv;
using namespace cv;
void ofApp::setup() {
cam.initGrabber(ofGetWidth(), ofGetHeight());
contourFinder.setMinAreaRadius(10);
contourFinder.setMaxAreaRadius(200);
}
@tado
tado / example
Created June 2, 2015 17:34
SonicPi example
live_loop :live do
use_synth :mod_dsaw
with_fx :reverb do
add_note = 0
8.times do
play choose([10, 14, 15, 17, 19]) + add_note, pan:rrand(-1.0, 1.0)
play choose([10, 14, 15, 17, 19]) + add_note + 12, pan:rrand(-1.0, 1.0)
sleep 0.5 * 0.5 * 0.5
add_note = add_note + 12.0
end
@tado
tado / ofApp.cpp
Last active August 29, 2015 14:22
Facetracker : face modify example
#include "testApp.h"
using namespace ofxCv;
void testApp::setup() {
ofSetVerticalSync(true);
cam.initGrabber(640, 480);
tracker.setup();
ofBackground(0);
}
#!/bin/bash
S="$1"
(echo "main(t){for(t=0;;t++)putchar($S);}" | clang -x c - -w -o /tmp/bytebeat && /tmp/bytebeat | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio)
@tado
tado / OpticalFlow_live.pde
Last active November 22, 2015 09:23
Draw OpticalFlow form livecam
// OpenCV輪郭抽出
// ライブカメラバージョン
import gab.opencv.*;
import processing.video.*;
Capture video; // ライブカメラ
OpenCV opencv; // OpenCV
void setup() {
@tado
tado / shaders_of_gray.pde
Created November 27, 2015 23:46
50 . Shades of Grey for Processing
size(800, 800);
float shades = 50.0;
noStroke();
for(int i = 0; i < shades; i++){
fill(color(255/shades*i));
rect(width/shades*i, 0, width/shades, height);
}