void ofxTLAudioTrack::generateEnvelope(int size){ envelope.clear(); for(int i = 0; i < size; i++) { envelope.push_back(ofBezierPoint(ofPoint(0.05,0), ofPoint(0.1, 0), ofPoint(0.2, 0), ofPoint(1.0, 0), ofMap(i, 0,size-1, 0,1) ).x); } }
//-------------------------------------------------------------- void testApp::update(){ //blurAmnt = ofMap(sin(ofGetElapsedTimef()),-1,1,.75f,1.25f); framerate = ofGetFrameRate(); if(demo){ pSystemDemo.update(); }else{ //pSystem.updateAll(10); //pSystem.calculate(); pSystemDemo.update(); kSystem.update(); kSystem.color.set(pSystemDemo.r,pSystemDemo.g,pSystemDemo.b); } light.setPosition(lightX,lightY,lightZ); //z = ofMap(ofGetElapsedTimef(),0,20,0,pSystemDemo.path.size()-1,true); posCameraPct = ofMap(ofGetElapsedTimef()-timeInitCamMovement,0,60,0,1,&ofEasing::quadOut,true); camera.setupPerspective(); //camera.setPosition(ofGetWidth()/2, ofGetHeight()/2, z); //665.108 + //camera.setPosition(pSystemDemo.path[z]); //lookAt.setPosition(ofGetWidth()/2,ofGetHeight()/2,ofLerp(0,ofGetWidth()*4,posCameraPct)); //camera.lookAt(ofVec3f(ofGetWidth()/2,ofGetHeight()/2,0)); camera.pan(-180+posCameraPct*180); /*ofBezierPoint(ofPoint(ofGetWidth()/2,ofGetHeight()/2,ofGetWidth()*4), ofPoint(ofGetWidth()/2,ofGetHeight()/2,ofGetWidth()*2), ofPoint(ofGetWidth()/2,ofGetHeight()/2,ofGetWidth()*2), pSystemDemo.path[0], posCameraPct));*/ prevCameraPos = ofBezierPoint(ofPoint(ofGetWidth()/2,ofGetHeight()/2,0), ofPoint(ofGetWidth()/6,ofGetHeight()/6,ofGetWidth()*1.5), ofPoint(ofGetWidth()/6,ofGetHeight()/6*3,ofGetWidth()*2.5), ofPoint(ofGetWidth()/2,ofGetHeight()/2,ofGetWidth()*4), posCameraPct); prevCameraPos.x += ofSignedNoise(prevCameraPos.x/100.)*100; prevCameraPos.y += ofSignedNoise(prevCameraPos.y/100.)*100; camera.setPosition(prevCameraPos); if(posCameraPct>=1) record = false; }
ofPoint DomeData::getBezierPoint(float t) { return ofBezierPoint(start, c1, c2, end, t); }