void Fish::display(){ //circle ofSetColor(r,g,b); ofEllipse(posX, posY, 100, 25); //fin ofSetColor(r,g,b); ofTriangle(posX-25, posY, posX-50, posY+25, posX-50, posY-25); }
//-------------------------------------------------------------- void testApp::draw(){ ofSetColor(0, 0, 0, 10); ofRect(ofGetWidth()/2,ofGetHeight()/2,ofGetWidth(), ofGetHeight()); ofSetColor(255, 0, 0, 255); ofEllipse(xPos, ofGetHeight()/2, 50, 50); ofSetColor(255, 0, 0, 20); ofEllipse(xPos, ofGetHeight()/2, 100,100); sizer-=.75; xPos+=displace; if(xPos>=3*ofGetWidth()/4 || xPos<=ofGetWidth()/4){ displace*=-1; sizer=50; } for(int i=0; i<numText;i++){ text[i].draw(); } }
void PlayerShot::render() { MusicEntity::render(); ofPushMatrix (); ofTranslate (pos.x, pos.y); ofFill(); ofSetColor(200, 255, 255); ofEllipse (0, 0, 3, 3); ofNoFill(); ofPopMatrix (); }
void circle::drawCircles(){ ofNoFill(); // ofSetColor(c, t); // ofCircle(pos.x, pos.y, rad); ofSetLineWidth(10); for(int i=0; i<10; i++){ float jitter = 10.0; // use mesh here ofEllipse(pos.x+ofRandom(-jitter, jitter), pos.y+ofRandom(-jitter, jitter), ofRandom(-100,100), rad+ofRandom(-jitter, jitter), rad+ofRandom(-jitter, jitter)); } }
//-------------------------------------------------------------- void testApp::update(){ ofSetWindowTitle(ofToString(ofGetFrameRate())); water.begin(); ofFill(); ofSetColor(ofNoise( ofGetFrameNum() ) * 255 * 5, 255); ofEllipse(mouseX,mouseY, 10,10); water.end(); water.update(); }
void rectangle::draw() { ofSetColor(r, 40, b); int ran = ofRandom(0, 100); if(ran < 5){ ofEllipse(pos.x, pos.y, size.x, size.y); } else{ ofRect(pos.x, pos.y, size.x, size.y); } }
//-----------------------------------------------. void guiTypePanel::drawLocked(){ ofPushMatrix(); ofFill(); ofTranslate(lockRect.x, lockRect.y, 0); ofSetColor(200, 0, 0, bgColor.getColorF()[3]*255.0); ofRect(0, 0, lockRect.width, lockRect.height); ofTranslate(LOCK_BORDER, LOCK_BORDER, 0); ofSetColor(255, 255, 255); ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT/2, LOCK_WIDTH * 0.8, LOCK_HEIGHT * 0.9); ofSetColor(200, 0, 0); ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT/2, LOCK_WIDTH * 0.8 * 0.6, LOCK_HEIGHT * 0.9 * 0.6); ofSetColor(255, 255, 255); ofRect(0, LOCK_HEIGHT/2, LOCK_WIDTH, LOCK_HEIGHT/2); ofPopMatrix(); }
void Circles::renderWave(){ for( int x = 0; x < yValues_length; x++){ ofEllipse( x * xSpacing, ofGetWindowHeight()/2 + yValues[x], yValues[(x + x) % coeVariable ] , yValues[(x + x + x) % coeVariable]); } }
void Bubble::draw(){ ofSetColor(color); if (mouseOver == true) { ofSetColor(mouseOverColor);} ofBeginShape(); ofEllipse(xPos, yPos, width, height); ofEndShape(); // ofPopMatrix(); // cout << xPos << "," << yPos << "..." << xPosLeft << "," << yPosLeft << "..." << xPosRight << "," << yPosLeft << endl; }
void BalloonControllerImage::draw() { ofFill(); ofSetColor(0, 0, 0, 255); ofEllipse(_model->getCenterX(), _model->getCenterY(), _model->getWidth(), _model->getHeight()); ofRectangle bounds = _model->getBoundsFromSize(_img.getWidth(), _img.getHeight()); ofSetColor(255, 255, 255, 255); _img.draw(bounds.x, bounds.y, bounds.width, bounds.height); }
//-------------------------------------------------------------- void testApp::draw(){ ofSetColor(242, 242, 242, 127); //描画色の設定(アルファ付き) ofLine(100, 300, 800, 500); //線を描く ofSetColor(242, 204, 47, 127); //描画色の再設定(アルファ付き) ofRect(200, 250, 200, 300); //四角形を描く ofSetColor(174, 221, 60, 127); //描画色の再設定(アルファ付き) ofCircle(450, 300, 150); //真円を描く ofSetColor(116, 193, 206, 127); //描画色の再設定(アルファ付き) ofEllipse(550, 500, 400, 300); //楕円を描く ofSetColor(211, 24, 24, 127); //描画色の再設定(アルファ付き) ofTriangle(700, 150, 450, 400, 750, 400); //三角形を描く }
void SakuraParticle::draw(){ ofSetColor(color); ofSetRectMode(OF_RECTMODE_CENTER); ofPushMatrix(); ofTranslate(position); ofRotateX(rot.x); ofRotateY(rot.y); ofRotateZ(rot.z); ofEllipse(0, 0, radius, radius * 1.4); ofPopMatrix(); ofSetRectMode(OF_RECTMODE_CORNER); }
//-------------------------------------------------------------- void Repeat_Embedded::draw() { ofBackground(0, 0, 0); ofSetColor(255, 255, 255); if(option == 1) { // Option 1: Stitches for(int x = 50; x <= width-50; x += 20) { for(int y = 50; y <= height-50; y += 20) { ofLine(x-5, y-5, x+5, y+5); ofLine(x+5, y-5, x-5, y+5); } } } else if(option == 2) { // Option 2: Perspective for(int x = 50; x <= width-50; x += 20) { for(int y = 50; y <= height-50; y += 20) { ofLine(x, y, width/2, height/2); } } } else if(option == 3) { // Option 3: Overlapping circles for(int x = 50; x <= width-50; x += 20) { for(int y = 50; y <= height-50; y += 20) { ofEllipse(x, y, 40, 40); } } } else if(option == 4) { // Option 3: Rotating arcs int count = 120; for(int x = 50; x <= width-50; x += 20) { for(int y = 50; y <= height-50; y += 20) { float s = ofMap(count, 0, 120, 0, TWO_PI*2, false); arc(x, y, 14, 14, s, s + PI); count--; } } } else if(option == 5) { // Option 3: Groups of five for(int x = 50; x <= width-50; x += 20) { for(int y = 50; y <= height-50; y += 20) { for(int i = 0; i < 16; i += 4) { ofLine(x + i, y, x + i, y+12); } ofLine(x, y, x + 12, y + 12); } } } }
void Lights::draw(){ // draw lights for (int i=0; i<points.size(); i++){ if ( (i+1) % (int) whichLight == 0 && bActive ){ ofSetColor(255); } else { ofSetColor(150); } ofEllipse(points[i], 20, 20 ); } whichLight += .5; if ( whichLight >= 4 ) whichLight = 1; }
void Boid::draw() { ofEnableDepthTest(); //ofSetColor(MIN(255, 60.f + 195.f * (pos.z + 20.f) / 40.f)); //if (personNearby) int tailLenTemp = max(tailLen - (int)(vel.length() * 3), 5); for (int i = 0; i < tailLenTemp; i++) { //tailLen - 1; i >= 0; i--) { int r = radius - (radius-2) * i / tailLenTemp; ofSetColor(155); ofEllipse(lastPos[i].x, lastPos[i].y, 0, r, r); ofSetColor(185); ofEllipse(lastPos[i].x, lastPos[i].y, 0.1, r - r/4.f, r - r/4.f); ofSetColor(225); ofEllipse(lastPos[i].x, lastPos[i].y, 0.2, r - r/2.f, r - r/2.f); ofSetColor(255); ofEllipse(lastPos[i].x, lastPos[i].y, 0.3, r - 3.f*r/4.f, r - 3.f*r/4.f); } ofEllipse(pos.x, pos.y, 0, 14,14); ofDisableDepthTest(); }
//-------------------------------------------------------------- void testApp::update() { ofSetWindowTitle(ofToString(ofGetFrameRate())); rip.begin(); ofFill(); ofSetColor(ofNoise( ofGetFrameNum() ) * 255 * 5, 255); ofEllipse(mouseX,mouseY, 10,10); rip.end(); rip.update(); bounce << rip.getTextureReference(); // bounce.update(); }
//-------------------------------------------------------------- void testApp::draw(){ ofSetColor(0, 255, 255); // ofCircle(x,y,w,h); ofEllipse(x,y,w,h); // yPos += acc; // acc += gravity; // if (yPos>480) { // acc=-acc/1.05; // } }
//------------------------------------------------------------------------------ void ofApp::draw() { ofBackground(0); float centerX = ofGetWidth() / 2; float centerY = ofGetHeight() / 2; ofPushMatrix(); ofTranslate(centerX,centerY); // create a new origin @ centerX, centerY ofEllipse(0,0,10,10); ofRotateZDeg(angleDegrees); ofLine(0,0,radius,0); // this push matrix will inherit the existing transformations ofPushMatrix(); ofTranslate(radius,0); ofEllipse(0,0,10,10); ofRotateZDeg(angleDegrees); ofLine(0,0,radius,0); ofPushMatrix(); ofTranslate(radius,0); ofScale(scaleX,scaleY); ofEllipse(0,0,10,10); ofPopMatrix(); ofPopMatrix(); ofPopMatrix(); }
//---------------------------------------------------------- void ofxVectorGraphics::ellipse(float x1,float y1, float w, float h){ if(bDraw){ ofEllipse(x1, y1, w, h); } if(bRecord){ if(bFill){ //there is no filled ellipse in non-path mode creeps.startPath(); creeps.addEllipse(x1, y1, w, h); creeps.endPath(CreEPS::FILL); } else creeps.ellipse(x1, y1, w, h); } }
void HUD::drawMini(int _blink){ spinner5.draw((0.080)*ofGetWindowWidth(),(0.126)*ofGetWindowHeight()); stepGraph1.draw(); for (int i = 0; i < unit2_1.size(); i++){ ofPushStyle(); ofSetColor(8,66,118); ofNoFill(); ofEllipse((0.128)*ofGetWindowWidth(), (.7045)*ofGetWindowHeight(), (103.0/1680)*ofGetWidth(), (103.0/1680)*ofGetWidth()); ofPopStyle(); unit2_1[i].draw((.128)*ofGetWindowWidth(), (.7045) * ofGetWindowHeight()); } for (int i = 0; i < unit2_2.size(); i++){ ofPushStyle(); ofSetColor(8,66,118); ofNoFill(); ofEllipse((0.128)*ofGetWindowWidth(), (.7045)*ofGetWindowHeight(), (131.0/1680)*ofGetWidth(), (131.0/1680)*ofGetWidth()); ofPopStyle(); unit2_2[i].draw((.128)*ofGetWindowWidth(), (.7045) * ofGetWindowHeight()); } }
void BalloonControllerNanna::draw() { ofFill(); ofSetColor(0, 0, 0, 255); ofEllipse(_model->getCenterX(), _model->getCenterY(), _model->getWidth(), _model->getHeight()); ofRectangle bounds = _model->getBoundsFromSize(_img.getWidth(), _img.getHeight()); float alpha = Expo::easeOut(timer.getTime(), 0, 255, timer.getDuration()); ofSetColor(255, 255, 255, 255); _img.draw(bounds.x, bounds.y, bounds.width, bounds.height); }
void MouseResponseColor::draw(){ int i, j; int height = ofGetHeight(); int width = ofGetWidth(); for(i = 0; i <= height; i += 20) { for(j = 0; j <= width; j += 20) { float dist_color = getDistance(mouseX, mouseY, i, j); dist_color = dist_color/max_distance * 100; ofSetColor(dist_color*5,dist_color*5,dist_color*5, 123); ofEllipse(i, j, 20, 20); } } }
//-------------------------------------------------------------- /*public */void ofxSimpleButton::render(){ if (bRender) { ofPushMatrix(); ofPushStyle(); ofTranslate(b_rect.x, b_rect.y); if (b_img_fbo.size() > 0 && b_shape == BUTTON_IMAGE) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(b_c, 255); if (b_img_fbo.size() == 2 && bToggle) { b_img_fbo[1].draw(0, 0); } else if (bAnimation && bang) { a_img_fbo.draw(0, 0); } else{ b_img_fbo[0].draw(0, 0); } ofDisableAlphaBlending(); ofPopStyle(); }else { ofPushStyle(); ofFill(); updateButtonColor(); if (b_shape == BUTTON_CIRCLE) { ofEllipse(b_rect.width/2, b_rect.height/2, b_rect.width, b_rect.height); }else if (b_shape == BUTTON_RECT){ ofRect(0, 0, b_rect.width, b_rect.height); }else if (b_shape == BUTTON_CUSTOM){ //using vertex? } ofPopStyle(); } if (useName) { ofPushStyle(); ofSetColor(b_c); ofDrawBitmapString(b_info_text, n_pos); ofPopStyle(); } if (useValue) { ofPushStyle(); ofSetColor(b_c); ofDrawBitmapString(b_val_text, v_pos); ofPopStyle(); } ofPopStyle(); ofPopMatrix(); } }
void Limb_Sect::display(){ ofSetLineWidth(line_wd); ofSetColor(limb_color); ofFill(); ofLine(pos.x, pos.y, end_pos.x, end_pos.y); // speed_point(); if(draw_ends) { ofSetColor(limb_color); ofFill(); ofEllipse(end_pos.x, end_pos.y, node_size, node_size); } }
void Ball::renderAtBodyPosition() { b2Vec2 pos = mBody->GetPosition(); ofPushStyle(); ofSetColor(250, 250, 0); // Set ball color ofFill(); ofPushMatrix(); ofTranslate(_toPixelX(pos.x), _toPixelY(pos.y)); ofEllipse(0, 0, radius, radius); ofPopMatrix(); ofPopStyle(); }
//-----------------------------------------------. void guiTypePanel::drawUnlocked(){ ofPushMatrix(); ofFill(); ofTranslate(lockRect.x, lockRect.y, 0); ofSetColor(0, 0, 0); ofRect(0, 0, lockRect.width, lockRect.height); ofTranslate(LOCK_BORDER, LOCK_BORDER, 0); ofSetColor(255, 255, 255); ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT * 0.4, LOCK_WIDTH * 0.8, LOCK_HEIGHT * 0.9); ofSetColor(0, 0, 0); ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT * 0.44, LOCK_WIDTH * 0.8 * 0.6, LOCK_HEIGHT * 0.9 * 0.6); ofSetColor(255, 255, 255); ofRect(0, LOCK_HEIGHT/2, LOCK_WIDTH, LOCK_HEIGHT/2); ofSetColor(0, 0, 0); ofRect(0, LOCK_HEIGHT * 0.5 - LOCK_HEIGHT * 0.25 , LOCK_WIDTH * 0.35, LOCK_HEIGHT * 0.25); ofPopMatrix(); }
//_________________________________ void rectangle::display(){ glPushMatrix(); glRotatef(theta, 0, 0, 20); glTranslatef(dist, 0, 0); ofFill(); ofSetColor(ofRandom(0,255), ofRandom(0,255), ofRandom(0,255)); float radius = 30 + 10 * sin(counter); ofEnableAlphaBlending(); ofEllipse(circx, circy, radius, radius); ofDisableAlphaBlending(); glPopMatrix(); }
void FlockShapeObject::drawGuiScreen(int x, int y, int w, int h) { aquarium.begin(); ofBackground(0); ofSetColor(255); wavy->renderGraphics(0,0, aquarium.getWidth(), aquarium.getHeight()); ofSetColor(0,127); ofRect(0,0, KINECT_X, KINECT_Y); ofSetColor(255); for (int i = 0; i < boids.size(); i++) { boids[i]->draw(); if (boids[i]->personNearby) ofLine(boids[i]->pos.x, boids[i]->pos.y, boids[i]->runAwayVec.x, boids[i]->runAwayVec.x); //ofLine(boids[i]->pos.x, boids[i]->pos.y, boids[i]->nearestPerson.x, boids[i]->nearestPerson.y); } ofSetColor(0,255,0); for (int i = 0; i < numPeople; i++) ofEllipse(people[i].x, people[i].y, 15, 15); ofSetColor(255,0,0); ofLine(boids[0]->minX, boids[0]->minY, boids[0]->maxX, boids[0]->minY); ofLine(boids[0]->maxX, boids[0]->minY, boids[0]->maxX, boids[0]->maxY); ofLine(boids[0]->maxX, boids[0]->maxY, boids[0]->minX, boids[0]->maxY); ofLine(boids[0]->minX, boids[0]->maxY, boids[0]->minX, boids[0]->minY); aquarium.end(); ofSetColor(255); aquarium.draw(x,y,w,h); // ofPushMatrix(); // wavy->renderGraphics(0,0, ofGetWidth(), ofGetHeight()); // mKinectTracker->drawDepthImage(0,0, ofGetWidth(), ofGetHeight()); // // ofTranslate(mImageWarper->getSrcPositions()[0].x, mImageWarper->getSrcPositions()[0].y); // // ofSetColor(255); // for (int i = 0; i < boids.size(); i++) { // boids[i]->draw(); // if (boids[i]->personNearby) // ofLine(boids[i]->pos.x, boids[i]->pos.y, boids[i]->pos.z, boids[i]->nearestPerson.x, boids[i]->nearestPerson.y, boids[i]->nearestPerson.z); // } // // ofSetColor(0,255,0); // for (int i = 0; i < numPeople; i++) // ofEllipse(people[i].x, people[i].y, 10, 10); // ofPopMatrix(); }
//-------------------------------------------------------------- void testApp::drawNoisyArmRect (float w, float h){ // A little helper function to simplify the code above. ofFill(); ofSetColor(255,255,255, 128); ofRect(-h/2,-h/2, w,h); ofNoFill(); ofSetColor(0); ofRect(-h/2,-h/2, w,h); ofSetColor(0); ofFill(); ofEllipse(0,0, 7,7); }
void Boid::draw(){ if(!isBody()) return; ofPushMatrix(); ofTranslate(getPosition().x, getPosition().y, 0); ofRotate(getRotation(), 0, 0, 1); ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(ofRandom(255),ofRandom(255),ofRandom(255)); // ofCircle(0, 0, getRadius()); ofEllipse(ofVec2f(0,0), 10, 10); ofPopStyle(); ofPopMatrix(); }