Skip to content

Instantly share code, notes, and snippets.

View loveandsheep's full-sized avatar

Sheep loveandsheep

View GitHub Profile
shader.begin();
shader.setUniformTexture("tex", buffer.getTexture(), 0);//白黒の図形を描画したofFbo
if (currentVid->isFrameNew())
shader.setUniformTexture("video", currentVid->getTexture(), 1);//ofVideoPlayerのテクスチャ
shader.setUniform4f("pl_1", pal.getColorArray(currentPalette)[0]);//配色用のofFloatColor配列
shader.setUniform4f("pl_2", pal.getColorArray(currentPalette)[1]);
shader.setUniform4f("pl_3", pal.getColorArray(currentPalette)[2]);
shader.setUniform4f("pl_4", pal.getColorArray(currentPalette)[3]);
@loveandsheep
loveandsheep / ofApp.cpp
Last active November 11, 2016 11:33 — forked from tado/ofApp.cpp
3次元空間の2つの点から平面の角度を計算
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(0);
ofSetDepthTest(true);
ofSetRectMode(OF_RECTMODE_CENTER);
posA.set(-80, -90, -200); // 開始点を設定
posB.set(100, 120, 130); // 終了点を設定
void liveCamKit::setup()
{
flag_checkCutUp = true;
lastFrame = 0;
}
void liveCamKit::update()
{
if (source && source->isFrameNew())
{
@loveandsheep
loveandsheep / main.cpp
Last active August 29, 2015 14:17
raspberry pi -> mac shutdown
#include "main.h"
using namespace std;
int main(){
atexit(onExit);
gpio_init();
phase = PHASE_OFF;
@loveandsheep
loveandsheep / gist:9166251
Last active August 29, 2015 13:56
MultiMeshDistort Example
MultiMeshDistort multiMesh;
void testApp::update(){
//マウス追従します。multiMesh.update(true);でも同じ処理を試せます
clearPoint();
addPoint(ofVec2f(ofGetMouseX(),ofGetMouseY()),
200.0,
sin(ofGetElapsedTimef())*50.0+50.0, false);
@loveandsheep
loveandsheep / ofxSimpleTheta.h
Last active January 2, 2016 22:19
oFでThetaのシャッターを切る簡単なサンプル。 アドオンのofxNetworkにあるofxTCPClientが必要です。
//
// ofxSimpleTheta.h
// ofxSimpleTheta
//
// Created by Ovis aries on 2014/01/11.
//
//
#ifndef ofxSimpleTheta_ofxSimpleTheta_h
#define ofxSimpleTheta_ofxSimpleTheta_h
@loveandsheep
loveandsheep / littleTimeSequencer.cpp
Created October 17, 2013 09:23
simple time measure class
#include "littleTimeSequencer.h"
void littleTimeSequencer::setup(float duration, bool bLoop)
{
targDuration = duration;
isPlaying = false;
isPause = false;
isLoop = bLoop;