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
// EneTable | |
// 電力データ読み込み用クラス | |
class EneTable { | |
String date; // 日付 | |
int data[][]; // データ | |
// コンストラクタ(初期化関数) | |
// ファイルを指定して、データをパース | |
EneTable(String filename) { |
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
// ファイルを指定して電力データを読み込む | |
// クラス(Class)バージョン | |
EneTable ene; | |
void setup() { | |
// 画面初期化 | |
size(800, 1004); | |
frameRate(30); | |
textSize(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
// This code worked width Xcode 6 Beta 6 | |
import SpriteKit | |
import XCPlayground | |
let width:CGFloat = 480.0 | |
let height:CGFloat = 800.0 | |
let canvasWidth: UInt32 = UInt32(width) | |
let canvasHeight: UInt32 = UInt32(height) |
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
import SpriteKit | |
import XCPlayground | |
let width:CGFloat = 400 | |
let height:CGFloat = 400 | |
let canvasWidth: UInt32 = UInt32(width) | |
let canvasHeight: UInt32 = UInt32(height) | |
let view:SKView = SKView(frame:CGRectMake(0, 0, width, height)) | |
let scene:SKScene = SKScene(size:CGSizeMake(width, height)) |
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
import SceneKit | |
import XCPlayground | |
let width:CGFloat = 400 | |
let height:CGFloat = 400 | |
var view = SCNView(frame: CGRect( | |
x: 0, | |
y: 0, | |
width: width, |
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
import SceneKit | |
import QuartzCore | |
class GameViewController: NSViewController { | |
@IBOutlet weak var gameView: GameView! | |
override func awakeFromNib(){ | |
var scene = SCNScene() |
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 "BlackmagicCapture.h" | |
BlackmagicCapture::BlackmagicCapture(int _width, int _height, float _framerate){ | |
width = _width; | |
height = _height; | |
framerate = _framerate; | |
cam.setup(width, height, framerate); | |
colorTexture.allocate(width, height, GL_RGB); | |
fbo.allocate(width, height); | |
fbo.begin(); |
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
// Processing realtime FFT analysis | |
import processing.sound.*; | |
AudioIn input; | |
FFT fft; | |
int bands=512; | |
float[] spectrum = new float[bands]; | |
public void setup() { |
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 "ParticleVec3.h" | |
ParticleVec3::ParticleVec3(){ | |
radius = 5.0; | |
friction = 0.01; | |
mass = 1.0; | |
position.set(ofGetWidth()/2.0, ofGetHeight()/2.0, 0); | |
velocity.set(0, 0, 0); | |
acceleration.set(0, 0, 0); | |
minx = 0; |
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
uniform float time; | |
uniform vec2 resolution; | |
uniform vec2 touches[10]; | |
float circle(vec2 p, vec2 center, float r) { | |
float d = distance(p, center); | |
return 1.0 * r / d; | |
} | |
void main( void ) { |