//-------------------------------------------------------------- void IndiaTower::drawingBeziel(){ ofEnableAlphaBlending(); vector<float> _inputBins = processFFT->fft.getBins(); float _numberIndexBins = _inputBins.size(); float _heightFassadeBins = baseArch->fassadeCorner[3].y - baseArch->fassadeCorner[0].y; float _rectHeightBins = _heightFassadeBins / _numberIndexBins; vector<float> _inputSpectrum = processFFT->getSpectrum(); float _numberIndexSpectrum = _inputSpectrum.size(); float _heightFassadeSpectrum = baseArch->fassadeCorner[3].y - baseArch->fassadeCorner[0].y; float _rectHeightSpectrum = _heightFassadeSpectrum / _numberIndexSpectrum; ofPushStyle(); ofSetColor( bezielcolor ); ofNoFill(); float _center = baseArch->framesCenter[11][0].x; float _xRatio = kasoPadInput.x; float _yRatio = kasoPadInput.y; if (bezielStart.size()>0) { for (int i=0; i<bezielStart.size(); i++) { ofDrawBezier(bezielStart[i].x, bezielStart[i].y, bezielStart[i].x - 100, bezielStart[i].y * _yRatio, bezielEnd[i].x + 100, bezielEnd[i].y * _yRatio, bezielEnd[i].x, bezielEnd[i].y); ofDrawBezier(_center * 2 - bezielStart[i].x, bezielStart[i].y, _center * 2 - bezielStart[i].x + 100, bezielStart[i].y * _yRatio, _center * 2 - bezielEnd[i].x - 100, bezielEnd[i].y * _yRatio, _center * 2 - bezielEnd[i].x, bezielEnd[i].y); } } ofPopStyle(); ofDisableAlphaBlending(); }
//-------------------------------------------------------------- void ofApp::draw(){ ofSetCircleResolution(25); ofSetColor(ofColor::darkOliveGreen); ofDrawCircle(eX, eY, 45); ofSetColor(ofColor::white); //left eye ofDrawCircle(eX - 20, eY - 15, 13); //right eye ofDrawCircle(eX + 20, eY - 15, 13); //pupils ofSetColor(ofColor::black); ofDrawCircle(eX - 15, eY - 12, 4); ofDrawCircle(eX + 15, eY - 12, 4); //mouth ofSetLineWidth(2); ofDrawLine(eX - 25, eY + 15, eX + 25, eY + 15); ofSetColor(ofColor::lightPink); ofDrawBezier(eX + 5, eY + 15, eX + 13, eY + 30, eX + 13, eY + 30, eX + 24, eY + 15); }
//-------------------------------------------------------------- void ofApp::arcDrawing() { ofPushStyle(); ofSetColor(baseColor); for (int i=0; i<mesh.getNumVertices()-1; i+=2) { ofVec3f _startPoint = mesh.getVertex(i); ofVec3f _endPoint = mesh.getVertex(i+1); ofVec3f _point14 = ((_endPoint-_startPoint)*0.40) + _startPoint; ofVec3f _point34 = ((_endPoint-_startPoint)*0.60) + _startPoint; ofVec3f _norm14 = (_point14 - ofVec3f(0,0,0)).normalize(); ofVec3f _norm34 = (_point34 - ofVec3f(0,0,0)).normalize(); ofVec3f _pt14 = _point14.normalize() * (point3D[i].radius + 70); ofVec3f _pt34 = _point34.normalize() * (point3D[i].radius + 70); ofNoFill(); ofDrawBezier(_startPoint.x, _startPoint.y, _startPoint.z, _pt14.x, _pt14.y, _pt14.z, _pt34.x, _pt34.y, _pt34.z, _endPoint.x, _endPoint.y, _endPoint.z); } ofPopStyle(); }
// draw (no style info) void ofxCurve::draw(bool bDrawControlPoints){ if(bDrawControlPoints){ ofDrawLine(start,startControl); ofDrawLine(end,endControl); ofDrawEllipse(startControl,5,5); ofDrawEllipse(endControl,5,5); } ofDrawBezier(start.x,start.y, start.z,startControl.x,startControl.y, startControl.z,endControl.x,endControl.y,endControl.z,end.x,end.y,end.z); }
//---------------------------------------------------------- void ofxVectorGraphics::bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4){ if(bDraw){ ofDrawBezier(x1, y1, x2, y2, x3, y3, x4, y4); } if(bRecord){ if(bFill){ creeps.startPath(x1, y1); creeps.addCurve(x2, y2, x3, y3, x4, y4); creeps.addLine(x1, y1); creeps.endPath(CreEPS::FILL); } else creeps.curve(x1, y1, x2, y2, x3, y3, x4, y4); } }
void Synapse::display(){ ofSetColor(0); ofSetLineWidth((weight+0.5) / (sm*0.5)); ofNoFill(); ofDrawBezier(preX, preY, brezierPoint.x, brezierPoint.y, brezierPoint.x, brezierPoint.y, postX, postY); ofSetLineWidth(1); ofFill(); ofDrawCircle(pointPosition,5); ofDrawBitmapString("d "+ofToString(round(100.0*(delayTime/samplespms))/100.0 ), box1.x, box1.y+9); ofDrawBitmapString("w "+ofToString(weight), box2.x, box2.y+9); }
//-------------------------------------------------------------- void ofApp::draw(){ ofBackground(255); ofSetColor(0); ofFill(); for(int i = 0 ; i < numPins; i++){ font.drawString("AnalogPin num:"+ofToString(i)+" - "+ofToString(analogValue[i]), 0, 100+100*i); } ofPushMatrix(); ofTranslate(ofGetWidth()-200, ofGetHeight()/2); //ofSetColor(20, 200, 200); ofNoFill(); ofDrawBezier(-550, 0, -256, -500*rad, 256, 110*rad, 550, 0); ofSetColor(255, 255, 255); ofDrawBitmapString(rad, 0, 0); ofPopMatrix(); }
//-------------------------------------------------------------- void ofApp::draw(){ ofBackground(20); if (bUseEasyCam) { easyCam.begin(); }else{ cam.begin(); } ofSetColor(ofColor::white) ; ofDrawLine(-200,-200,0,200,-200,-400); ofDrawLine(-200,-200,0,-200,200,0); ofDrawLine(-200,-200,0,200,-200,400); ofNoFill(); ofSetLineWidth(3); ofSetColor(ofColor::aqua); for(int i=0; i<41; i++){ ofBeginShape(); int x1 = 150-4*i; int x2 = -200+4*i; int y = -190+10*i; int z1 = 350-5*i; int z2 = -100+5*i; int z3 = z2*-1; int z4 = z1*-1; ofDrawBezier(x1, y, z1, x2, y, z2, x2, y, z3, x1, y, z4 ); ofEndShape(); } ofSetLineWidth(1); ofSetColor(ofColor::aqua,50); for(float j=0; j<200; j++){ ofBeginShape(); float xx1 = 150-0.8*j; float xx2 = -200+0.8*j; int yy = -190+2*j; int zz1 = 350-1*j; int zz2 = -100+1*j; float zz3 = zz2*-1; float zz4 = zz1*-1; ofDrawBezier(xx1, yy, zz1, xx2, yy, zz2, xx2, yy, zz3, xx1, yy, zz4 ); ofEndShape(); } // ofFill(); // ofSetColor(255,10); // for(int i=0; i<40; i++){ // ofBeginShape(); // int x1 = 150-4*i; // int x2 = -200+4*i; // int y = -190+10*i; // int z1 = 350-5*i; // int z2 = -100+5*i; // int z3 = z2*-1; // int z4 = z1*-1; // // ofVertex(x1, y, z1); // ofBezierVertex(x2, y, z2, x2, y, z3, x1, y, z4 ); // ofEndShape(); // } ofDisableDepthTest(); if (bUseEasyCam) { easyCam.end(); }else{ cam.end(); } string str = "Currently using: "; if (bUseEasyCam) { str += "ofEasyCam"; }else{ str += "ofx2DCam\n\n"; str += "ofx2DCam use:\n"; str += " Drag mouse with:\n"; str += " Left Button: move\n"; str += " Right button: zoom\n"; str += " Mouse scroll: zoom\n\n"; str += "Set LookAt: key:\n"; str += " RIGHT r\n"; str += " LEFT l\n"; str += " TOP t\n"; str += " BOTTOM b\n"; str += " FRONT f\n"; str += " BACK a\n\n"; str += "Current LookAt: "; switch (cam.getLookAt()) { case ofx2DCam::OFX2DCAM_FRONT: str+="FRONT \n"; break; case ofx2DCam::OFX2DCAM_BACK: str+="BACK \n"; break; case ofx2DCam::OFX2DCAM_LEFT: str+="LEFT \n"; break; case ofx2DCam::OFX2DCAM_RIGHT: str+="RIGHT \n"; break; case ofx2DCam::OFX2DCAM_TOP: str+="TOP \n"; break; case ofx2DCam::OFX2DCAM_BOTTOM: str+="BOTTOM \n"; break; default: break; } } ofDrawBitmapStringHighlight(str, 4,120); str="3D : Utility surface\n"; ofDrawBitmapStringHighlight(str, 4,70, ofColor::black, ofColor::yellow); str = "TOP : Indifference curve"; ofDrawBitmapStringHighlight(str, 4,90,ofColor::black,ofColor::greenYellow); str="Press the spacebar to switch between\n"; str += "projective ofEasyCam and orthogonal ofx2DCam.\n"; ofDrawBitmapStringHighlight(str, 4,12, ofColor::magenta, ofColor::black); }