示例#1
5
FFTTracer::FFTTracer(){
    fft_size = ((testApp*)ofGetAppPtr())->fft_size;
    magnitude = new float[fft_size];
    
    for (int i = 0; i < fft_size; i++) {
        ofVec3f p = ofVec3f(0, 0, 0);
        pos.push_back(p);
        ofVec3f v = ofVec3f(0, 0, 0);
        vel.push_back(v);
        
        Tracker *t = new Tracker;
        t->setup();
        t->setTrackerLength(10);
        trackers.push_back(t);
    }
    
    //ばねパラメータ
    /*
     stiffness = 1.0;
     damping = 0.9;
     mass = 100.0;
     */
    stiffness = 2.0;
    damping = 0.92;
    mass = 200;
    
    //((testApp*)ofGetAppPtr())->cam.setPosition(0, 0, -200);
    //((testApp*)ofGetAppPtr())->cam.lookAt(ofVec3f(0,0,0));
    //camStart = ofPoint(0,0,-200);
    //camEnd = camStart;
    resetCam();
}
示例#2
0
//--------------------------------------------------------------
void ofApp::setup() {
	ofSetFrameRate(60);
	ofSetVerticalSync(true);
	
	rotate = 0;
	
	// setup bvh
	bvh[0].load("bvhfiles/kashiyuka.bvh");
	bvh[1].load("bvhfiles/nocchi.bvh");
	bvh[2].load("bvhfiles/aachan.bvh");
	
	for (int i = 0; i < 3; i++)	{
		bvh[i].play();
	}
	
	track.loadSound("Perfume_globalsite_sound.wav");
	track.play();
	track.setLoop(true);
	
	// setup tracker and drawer
	for (int i = 0; i < 3; i++)
		{
		ofxBvh &b = bvh[i];
		Drawer *d = new Drawer;
		
		for (int n = 0; n < b.getNumJoints(); n++) {
			const ofxBvhJoint *o = b.getJoint(n);
			Tracker *t = new Tracker;
			t->setup(o);
			t->setTrackerLength(trackerLength);
			trackers.push_back(t);
			d->add(o);
		}
		
		drawers.push_back(d);
		}
	
	ofPushMatrix();
	ofTranslate(0, -100);
	ofScale(1, 1, 1);
	ofRotateX(90);
	camera.setFov(90);
	camera.lookAt(ofVec3f(0,0,0));
	camera.setPosition(300, 30, 300);
	//camera.disableMouseInput();
	ofPopMatrix();
	background.loadImage("background.png");
	
}
示例#3
0
//--------------------------------------------------------------
void ofApp::setup() {
	ofSetFrameRate(60);
	ofSetVerticalSync(true);	
	
	rotate = 0;
	
	// setup bvh
	bvh[0].load("bvhfiles/kashiyuka.bvh");
	bvh[1].load("bvhfiles/nocchi.bvh");
	bvh[2].load("bvhfiles/aachan.bvh");
	
	for (int i = 0; i < 3; i++)	{
		bvh[i].play();
	}
	
	track.load("Perfume_globalsite_sound.wav");
	track.play();
	track.setLoop(true);
	
	// setup tracker
	for (int i = 0; i < 3; i++)
	{
		ofxBvh &b = bvh[i];
		
		for (int n = 0; n < b.getNumJoints(); n++) {
			const ofxBvhJoint *o = b.getJoint(n);
			Tracker *t = new Tracker;
			t->setup(o);
			t->setTrackerLength(trackerLength);
			trackers.push_back(t);
		}
	}
	
	camera.setFov(45);
	camera.setDistance(360);
	camera.disableMouseInput();
	
	background.load("background.png");
	
}