//-------------------------------------------------------------- void ofApp::draw(){ ofEnableAlphaBlending(); ofBackground(0,0,0,0); ofEnableBlendMode(OF_BLENDMODE_ADD); ofEnableLighting(); pointLight.enable(); ofSetColor(255); //drawTwoRings(); for (int i = 0; i < 360; i+=15) { //float moveDim = ofGetElapsedTimef()/2; //if (midD.bang) midD.moveDim++; if (midD.bang && i%2==0) midD.moveDim++; float rad = i*PI/180; float posx = ofGetWidth()/2 + ofGetWidth()/10 *cos(rad + midD.moveDim); float posz = ofGetHeight()/2; float posy = ofGetHeight()/2 + ofGetWidth()/10 *sin(rad + midD.moveDim); //ofDrawSphere(posx, posy, posz, 10); ofPushMatrix(); ofTranslate(posx, posy, posz); ofRotate(120, 1, 1, 1); ofDrawCone(0, -20-500*midD.vol, 0, 10, 20+1000*midD.vol); ofPopMatrix(); } /* for (int i = 0; i < 8; i++) { float lastx = -999; float lasty = -999; float ynoise = ofRandom(10); float orientX = 10; float orientY = 0; float y; float limitX = orientX + ofGetWidth()*hVol; for (int x = orientX; x < limitX ; x++) { y = orientY + ofNoise(ynoise) * 80; if (lastx > -999) { ofLine(x, y, lastx, lasty); } lastx = x; lasty = y; ynoise += 0.1; } }*/ float ynoise = ofRandom(10); //float y; float x; // float orientX = ofGetWidth()/2; // float orientY = 0; float orientY = ofGetHeight()/2; float orientX = 10; // float limitX = orientX + ofGetWidth()*hVol; // float limitMinX = orientX - ofGetWidth()*hVol; float multiplyVal = 80; //if (highD.bang) multiplyVal = 500; float limitY = 0 + ofGetHeight()/2*highD.vol*3.5; float limitMinY = ofGetHeight() - ofGetHeight()/2*highD.vol*3.5; float lastx = -999; float lasty = -999; for (int y = 0; y < limitY ; y++) { float xNoise = ofNoise(ynoise); x = orientX + xNoise * multiplyVal; if (lasty > -999) { ofLine(x, y, lastx, lasty); } ynoise += 0.1; x = orientX + ofNoise(ynoise) * multiplyVal; if (lasty > -999) { ofLine(x, y, lastx, lasty); } lastx = x; lasty = y; ynoise += 0.1; //if (y%2==0) xNoise *= -1; orientX += xNoise; } orientX = 10; float lastMinX = -999; float lastMinY = -999; for (int y = ofGetHeight(); y > limitMinY ; y--) { float xNoise = ofNoise(ynoise); x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinY > -999) { ofLine(x, y, lastMinX, lastMinY); } ynoise += 0.1; x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinY > -999) { ofLine(x, y, lastMinX, lastMinY); } lastMinX = x; lastMinY = y; ynoise += 0.1; orientX += xNoise; } float lastx2 = -999; float lasty2 = -999; orientX = ofGetWidth()-100; for (int y = 0; y < limitY ; y++) { float xNoise = ofNoise(ynoise); x = orientX + ofNoise(ynoise) * multiplyVal; if (lasty2 > -999) { ofLine(x, y, lastx2, lasty2); } ynoise += 0.1; x = orientX + ofNoise(ynoise) * multiplyVal; if (lasty2 > -999) { ofLine(x, y, lastx2, lasty2); } lastx2 = x; lasty2 = y; ynoise += 0.1; orientX -=xNoise; } float lastMinX2 = -999; float lastMinY2 = -999; orientX = ofGetWidth()-100; for (int y = ofGetHeight(); y > limitMinY ; y--) { float xNoise = ofNoise(ynoise); x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinY2 > -999) { ofLine(x, y, lastMinX2, lastMinY2); } ynoise += 0.1; x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinY2 > -999) { ofLine(x, y, lastMinX2, lastMinY2); } lastMinX2 = x; lastMinY2 = y; ynoise += 0.1; orientX -=xNoise; } if (highD.bang) { orientX = ofGetWidth()/2-50; x = orientX + ofNoise(ynoise) * multiplyVal; if (lastx > -999) { ofLine(x, orientY, lastx, lasty); } x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinX > -999) { ofLine(x, orientY, lastMinX, lastMinY); } orientX = ofGetWidth()/2-30; x = orientX + ofNoise(ynoise) * multiplyVal; if (lastx2 > -999) { ofLine(x, orientY, lastx2, lasty2); } x = orientX + ofNoise(ynoise) * multiplyVal; if (lastMinX2 > -999) { ofLine(x, orientY, lastMinX2, lastMinY2); } } drawShader(); pointLight.disable(); ofDisableLighting(); }
//-------------------------------------------------------------- void ofApp::draw(){ // ofSetRectMode(OF_RECTMODE_CORNER); drawShader(); }