This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; package | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
;; basic settings | |
(set-language-environment 'utf-8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
// 画面基本設定 | |
ofSetFrameRate(60); //秒間60コマで描画 | |
ofBackground(0); //背景を黒に | |
//位置と速度を初期化 | |
location = ofVec2f(ofGetWidth()/2, ofGetHeight()/2); //画面の中心に |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
//単純な楽器の定義 | |
SynthDef("scsine", { | |
arg freq; | |
var out, env; | |
out = SinOsc.ar(freq).dup(); | |
env = EnvGen.ar(Env.perc(), doneAction:2); | |
Out.ar(0, out*env); | |
}).add; | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup(){ | |
ofBackground(0); | |
ofNoFill(); | |
ofSetColor(255); | |
} | |
void ofApp::update(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(windowWidth, windowHeight); | |
} | |
function draw() { | |
var unitSize = windowHeight / 8.0; | |
var length30 = unitSize * (1.0 + sqrt(3)) / sqrt(2); | |
var length60 = unitSize * sqrt(3); | |
var length90 = unitSize * sqrt(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float theta = 2.0 * PI * ofRandom(1.0); | |
float phi = acos(2.0 * ofRandom(1.0) - 1.0); | |
float x = radius * sin(phi) * cos(theta); | |
float y = radius * sin(phi) * sin(theta); | |
float z = radius * cos(phi); | |
ofVec3f location = ofVec3f(x, y, z); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_synth :fm | |
play 60 | |
sleep 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(1200, 600); | |
background(0); | |
stroke(255); | |
noFill(); | |
for(int i = 0; i < 100000; i++){ | |
float x = random(width/2); | |
float y = random(height); | |
point(x, y); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int NUM = 5000; | |
ParticleVec2[] particles = new ParticleVec2[NUM]; | |
void setup() { | |
//初期設定 | |
size(1280, 720, P3D); | |
frameRate(60); | |
noStroke(); | |
fill(255); | |
for (int i = 0; i < NUM; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
ofBackground(0); | |
ofSetDepthTest(true); | |
ofSetRectMode(OF_RECTMODE_CENTER); | |
posA.set(-80, -90, -200); // 開始点を設定 | |
posB.set(100, 120, 130); // 終了点を設定 |