Example #1
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(0);
    ofSetFrameRate(60);
    ofSetCircleResolution(12);
    ofEnableBlendMode(OF_BLENDMODE_ADD);
    for (int i = 0; i < num; i++) {
        position[i].x = ofRandom(ofGetWidth());
        position[i].y = ofRandom(ofGetHeight());
        position[i].z = ofRandom(ofGetHeight());
        velocity[i].x = ofRandom(-5, 5);
        velocity[i].y = ofRandom(-5, 5);
        velocity[i].z = ofRandom(-5, 5);
        color[i].r = ofRandom(255);
        color[i].g = ofRandom(255);
        color[i].b = ofRandom(255);
        
    }
    
}
Example #2
0
// 最初に一回だけ呼び出される関数
//---画面やデバイスの初期化を行う-----------------------------------------------------------
void testApp::setup(){
    ofSetLogLevel(OF_LOG_VERBOSE);
	ofLog(OF_LOG_VERBOSE, "Start setup dao");

	// 画面の設定
    ofSetFrameRate(60);
	ofSetCircleResolution(128);
	ofBackground(255, 255, 255);
	ofSetWindowShape(300, 300);
	ofEnableSmoothing();
	
	// 最初の円を一つ作る
	speeds.push_back(new ofPoint(3, 4));
	locs.push_back(new ofPoint(100, 100));
	ofColor *color = new ofColor();
	color->r = 0;
	colors.push_back(color);
	circleCount++;
}
void DotPolygonHit::draw(){
    
    
    ofSetColor(0);
    setLineWidth(1);
    ofSetCircleResolution(20);
    for (int i=0; i<numPoints; i++){
        lines[i].draw();
    }
    
    ofFill();
    
    for (int i=0; i<numPoints; i++){
        ofSetColor(0);
        ofDrawCircle(points[i].x, points[i].y, pointSize[i]);
        ofSetColor(whiteVal);
        ofDrawCircle(points[i].x, points[i].y, pointSize[i]*0.75);
    }
}
//--------------------------------------------------------------
void ofApp::setup(){

	ofSetVerticalSync(true);
	ofBackground(ofColor::darkGray);
	ofSetWindowTitle("Millis");
	ofSetCircleResolution(50);
	
	// red circle
	redX = ofGetWidth()/2;
	redY = ofGetHeight()/2;
	redMillis = 0; // init timestamp
	showRed = false; // don't show yet
	
	// green circle
	greenX = ofRandom(20, ofGetWidth()-20);
	greenY = ofRandom(20, ofGetHeight()-20);
	greenMillis = 0;
	moveGreen = true;
}
//--------------------------------------------------------------
void testApp::setup(){
	
    
	ofSetVerticalSync(true);
//    ofSetFrameRate(120);
    ofSetBackgroundAuto(false);
	ofBackground(0,0,0);
	ofSetCircleResolution(100);
    ofEnableAlphaBlending();
    
    counter = 0;
    
    for (int i = 0; i < 2; i++) {
        Sphere s;
        s.setup();
        spheres.push_back(s);
    }

}
//--------------------------------------------------------------
void ofApp::draw(){
    ofSetCircleResolution(100);
    //ofSetHexColor(A8383B);
    //ofSetColor(0,100,100);
    ofSetColor(168,56,59);
    
    if (activateSize == true) {
        for (int i = 0; i < 9; i++){
            circles[i].x += 60*(i+1);
            circles[i].r = buckets[i]/50;
            cout << buckets[i] <<endl;
        }
    }
    
    
    
    o = 20;
    
    for (int i = 0; i < 9; i++){
        ofSetColor(168,56,59,circles[i].transp);
        ofDrawCircle(circles[i].x, circles[i].y, circles[i].r);
        if (i == 0) ofDrawBitmapString("Micro", circles[i].x - o, circles[i].y + 150);
        else if (i == 1) ofDrawBitmapString("Minor", circles[i].x - o, circles[i].y + 150);
        else if (i == 2) ofDrawBitmapString("MinorII", circles[i].x - o, circles[i].y + 150);
        else if (i == 3) ofDrawBitmapString("Light", circles[i].x - o, circles[i].y + 150);
        else if (i == 4) ofDrawBitmapString("Moderate", circles[i].x - o, circles[i].y + 150);
        else if (i == 5) ofDrawBitmapString("Strong", circles[i].x - o, circles[i].y + 150);
        else if (i == 6) ofDrawBitmapString("Major", circles[i].x - o, circles[i].y + 150);
        else if (i == 7) ofDrawBitmapString("Great", circles[i].x - o, circles[i].y + 150);
        else if (i == 8) ofDrawBitmapString("GreatII", circles[i].x - o, circles[i].y + 150);
    }
    
    
    stringstream ss;
    ss << "(m) activate magnitude" << "\n";
    ss << "(b): back" << "\n";
    ss << "(s): stop vibrations" << "\n";
    ss << "click on dots to activate" << endl << "\n" << "\n" << "\n";
    ss << "2016 Earthquakes on Richter Magnitude Scale" << endl;
    ofDrawBitmapString(ss.str().c_str(), 20, 20);
    

}
Example #7
0
//--------------------------------------------------------------
void ofApp::draw(){
    ofBackground(0, 0, 0);
    ofPushMatrix();
    {
        ofTranslate(ofGetWidth()/2, ofGetHeight()/2);
        ofPushMatrix();
        {
            ofScale(scale, scale);
            
            ofPushStyle();
            ofSetCircleResolution(60);
            ofPushMatrix();
            {
                ofNoFill();
                for(int i = 0; i < 10; i++) {
                    float radius = ofMap(i, -1, 10 - 1, 0, 5600);
                    ofSetColor(64);
                    ofCircle(0, 0, radius);
                    ofVec2f textPosition = ofVec2f(radius, 0).rotate(45);
                    ofSetColor(255);
                    ofDrawBitmapString(ofToString(radius, 2) + "mm", textPosition);
                }
            }
            ofPopMatrix();
            if(drawTrackPoints){
                for(map<int, ofVec2f>::iterator iter = points.begin(); iter!=points.end(); iter++){
                    ofPushStyle();
                    ofNoFill();
                    ofSetColor(255, 0, 255);
                    ofCircle(iter->second, 50);
                    ofPopStyle();
                }
            }
            ofSetColor(255, 255, 0);
            if(drawMesh) mesh.drawVertices();
        }
        ofPopMatrix();
    }
    ofPopMatrix();
    
    panel.draw();
}
Example #8
0
//--------------------------------------------------------------
void ofApp::setup(){
    
    ofBackground(224,255,255);   //(0,128,0)
    ofSetCircleResolution(64);
    
//    //clound begin pistion
//    myCircleX = 100;
//    myCircleY = 100;
//    
//    myCircleX1 = 300;
//    myCircleY1 = 100;
    
    
    //from example
    ofSetVerticalSync(true);
    // slow       = 1
    // faster     = 2
    // super fast = 3
    mode = 1;
    
    //sound
    sounds[0].loadSound("Pig-SoundBible.com-1026656068.mp3");
    sounds[1].loadSound("Merlin-Mark_Mattingly-901094861.mp3");
    sounds[2].loadSound("Pig Oinking-SoundBible.com-1904855325.mp3");
    sounds[3].loadSound("Snorting-SoundBible.com-748123769.mp3");
    
    //pigs making sound
    for (int i = 0; i<THREEPIG; i++) {
        pigpig[i].setup();
        
        pigpig[i].x = ofRandomWidth();
        pigpig[i].y = ofRandomHeight();
        pigpig[i].vx = ofRandom(-10,10);
        pigpig[i].vy = ofRandom(-10,10);
    }
    
    //display pig and wolf
    piggy.setup();
    wolfy.setup();


}
Example #9
0
//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(255,255,255);

    /* //Another way of zooming
    float zoom = 0.08;
    glPushMatrix();
    glTranslatef(100,50,0);
    glScalef(zoom,zoom,0);
    image.draw(w/8, h/8);
    glPopMatrix();*/

    image.draw(imgPos.x, imgPos.y, image.width, image.height);
    ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());

    ofSetColor(57, 74, 84);
    ofNoFill();
    ofSetLineWidth(10);
    ofSetCircleResolution(500);
    ofCircle(mousePos.x, mousePos.y, radius);

    ofPath magnifierPath;
    ofMesh magnifierMesh;
    magnifierPath.setCircleResolution(100);
    magnifierPath.setFilled(true);
    magnifierPath.circle(mousePos.x, mousePos.y, radius);
    magnifierPath.close();
    magnifierMesh=magnifierPath.getTessellation();

    for (int i=0; i<magnifierMesh.getNumVertices(); i++) {
        ofVec2f vertPos = magnifierMesh.getVertex(i);
        ofVec2f zoomedPos = ((vertPos - mousePos) / zoomFactor) + mousePos;
        ofVec2f uvPos = zoomedPos - imgPos;
        magnifierMesh.addTexCoord(uvPos);
    }


    ofSetColor(255, 255, 255);
    image.bind();
    magnifierMesh.draw();
    image.unbind();

}
Example #10
0
void testApp::drawDebug() {
	debugFbo.begin();
	glDisable(GL_DEPTH_TEST);
	ofPushMatrix();
	ofClear(0);

	ofSetCircleResolution(50);
			
	ofSetColor(200,0,0);
	ofCircle(ofPoint(ofGetWidth() - 350,350),getBass()*350);

	ofSetColor(255,0,200);
	ofCircle(ofPoint(ofGetWidth() - 350,350),getSub()*300);
			
	ofSetColor(0,200,200);
	ofCircle(ofPoint(ofGetWidth() - 350,750),getPlink()*200);

    ofSetColor(0,0,255);
	ofCircle(ofPoint(ofGetWidth() - 350,750),getHiSynth()*200);

		for(int i = 0; i < 512; i++) {
			if(i%2 == 0){
				ofSetColor(255);
			}else{
				ofSetColor(200);
			}
			ofRect(i*20,0,0,20,softMagnitude[i]*100);

			
			
		}

		stringstream bandNumber; 
		bandNumber  << "Band: " << floor((double) mouseX/20);
		ofDrawBitmapString(bandNumber.str(),mouseX,mouseY);
		
	ofPopMatrix();
	
	debugFbo.end();
	debugFbo.draw(0,0,ofGetWidth(),ofGetHeight());
	glEnable(GL_DEPTH_TEST);
}
Example #11
0
//--------------------------------------------------------------
void ofApp::setup()
{
	ofSetVerticalSync(true);
	ofEnableSmoothing();

    //set some sketch parameters
    //Background Color
    red = 233;
    blue = 240;
    green = 52;
    alpha = 200;
    radius = 150;
    drawFill = true;
    backgroundColor = ofColor(233, 52, 27);
    resolution = 30;
    position = ofPoint(ofGetWidth()*.5, ofGetHeight()*.5);
    ofSetCircleResolution(resolution);

    gui = new ofxUISuperCanvas("VARIABLE BINDING");

    gui->addSpacer();
    gui->addLabel("BACKGROUND", OFX_UI_FONT_MEDIUM);
    gui->addSpacer();
    gui->addSlider("BGR", 0, 255, backgroundColor.r);
    gui->addSlider("BGG", 0, 255, backgroundColor.g);
    gui->addSlider("BGB", 0, 255, backgroundColor.b);
    gui->addSpacer();
    gui->addLabel("CIRCLE CONTROL");
    gui->addSlider("RED", 0.0, 255.0, red);
	gui->addSlider("GREEN", 0.0, 255.0, green);
    gui->addSlider("BLUE", 0.0, 255.0, blue);
    gui->addSlider("ALPHA", 0.0, 255.0, alpha);
    gui->addSlider("RADIUS", 0.0, 600.0, radius);
	gui->addSlider("RESOLUTION", 3, 60, resolution);
    gui->addLabelToggle("DRAW FILL", drawFill);
    gui->add2DPad("POSITION", ofPoint(0, ofGetWidth()), ofPoint(0, ofGetHeight()), position);
    gui->addSpacer();
    gui->addTextArea("TEXT AREA", "HIDE & SHOW GUI BY PRESSING 'g'. MOUSE OVER A SLIDER AND PRESS UP, DOWN, LEFT, RIGHT", OFX_UI_FONT_SMALL);
    gui->autoSizeToFitWidgets();
    ofAddListener(gui->newGUIEvent,this,&ofApp::guiEvent);
    gui->loadSettings("guiSettings.xml");
}
Example #12
0
//--------------------------------------------------------------
void testApp::setup(){
	ofSetVerticalSync(true);
	ofBackground(255, 255, 255);
	console = new ofxConsole();
	testInt = 0;
	
	ofSetCircleResolution(45);

	//set key to open and close the console (default is '+')
	console->setToggleKey('#');
	
    //just a welcome message :)
	console->print("Welcome to the alpha version of ofxConsole! YEAAAH DUUDE!");
	
	//We can add pointers to variables, which can be changed through the console.
	console->addItem("testInt", &testInt, CTYPE_INT);
	
	//We can add pointers to variables, which can be changed through the console.
	console->addItem("alphaBlending", &bAlphaBlending, CTYPE_BOOL);
	
	console->addFunction("randomBackground", this, &testApp::randomBackground);
	console->addFunction("setBackground", this, &testApp::setBackground);
	console->addFunction("quit", this, &testApp::quit);

	/*this is just to show the difference between the syntax of adding a boost callback and a "normal" one. 
	 The boost part is some syntactic c++ madness but pretty straight forward to use and alot more powerful
	 than the default version since you can register almost any void function you
	 want! (you should keep in mind though that since it is a textconsole things other than long, int, float, double, bool
	 and string dont really make sense, the varying amount of arguments is the real plus!)*/
	
	/*EDIT: Actually you should be able to leave the type cast to boost::function out, but for some reason that did
	 not work for me*/
#ifdef USE_BOOST
	console->addFunction("setBackgroundBoostWay", (boost::function< void(int, int, int) >)
						 (boost::bind(&testApp::setBackground, this, _1, _2, _3)));
	console->addFunction("charFunc", (boost::function< void(double) >)
						 (boost::bind(&testApp::doubleFunc, this, _1)));
	console->addFunction("addCircle", (boost::function< void() >)
						 (boost::bind(&testApp::addCircle, this)));
#endif
	
}
Example #13
0
//--------------------------------------------------------------
void testApp::setup(){

	counter = 0.0;
	spin	= 0.0;
	spinPct	= 0.0;
	mouseX  = 263;
	mouseY  = 267;
	bFirstMouseMove = true;

	//set background to black
	ofBackground(0, 0, 0);

	//lets make our circles look a little nicer!
	ofSetCircleResolution(40);

	//for smooth animation, set vertical sync if we can
	ofSetVerticalSync(true);
	// also, frame rate:
	ofSetFrameRate(60);
}
Example #14
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(255, 255, 255);
    ofSetCircleResolution(64);
    ofEnableAlphaBlending();
    ofSetFrameRate(60);
    
    ball0 = new Ball(40);
    ball0->mass = 2;
    ball0->x = 50;
    ball0->y = ofGetHeight()/2;
    ball0->vx = 1;
    ball0->setFillColor(ofColor(255, 0, 0));
    
    ball1 = new Ball(25);
    ball1->mass = 1;
    ball1->x = 300;
    ball1->y = ofGetHeight()/2;
    ball1->vx = -1;
    ball1->setFillColor(ofColor(255, 0, 0));
}
Example #15
0
//--------------------------------------------------------------
void ofApp::draw(){
	ofBackground(200);
	
	ofPushMatrix();
	ofPushStyle();
	
	ofTranslate(ofGetWindowWidth() / 2, ofGetWindowHeight() / 2);
	ofSetCircleResolution(32);
	float diff = ofGetElapsedTimef() - floor(ofGetElapsedTimef());
	for( int i = 16; i > 0; i-- ) {
		ofFill();
		ofSetColor(ofMap(i, 0, 16, 50, 200));
		ofCircle(0, 0, ofMap(i - diff, 0, 16, 0, ofGetWindowWidth() / 2));
	}
	
	ofPopStyle();
	ofPopMatrix();
	
	spidar.draw(0xfefefe);
}
Example #16
0
//--------------------------------------------------------------
void testApp::setup() {
    tspsReceiver.connect(12000);

    //ofSetRectMode(OF_RECTMODE_CENTER);
    ofEnableSmoothing();
    ofBackground(30);
    ofSetFrameRate(60);
    ofSetCircleResolution(60);

    centroid.x = ofGetHeight() / 2;
    x = ofGetHeight() / 2;
    y = ofGetWidth() / 2;
    xSpeed = 5;
    ySpeed = 5;
    boardWidth = 100;
    boardHeight = 10;
    ballSize = 10;

    boundary = 0;
}
//--------------------------------------------------------------
void guiCircle::setup(){
    ofSetFrameRate(60);
    ofBackground(127);
    ofSetCircleResolution(32);
    
    // Set initial, min, and max value of color
    ofColor initColor = ofColor(0, 127, 255, 255);
    ofColor minColor = ofColor(0, 0, 0, 0);
    ofColor maxColor = ofColor(255, 255, 255, 255);
    
    // Set initial, min, and max value of position
    ofVec2f initPos = ofVec2f(ofGetWidth()/2, ofGetHeight()/2);
    ofVec2f minPos = ofVec2f(0, 0);
    ofVec2f maxPos = ofVec2f(ofGetWidth(), ofGetHeight());
    
    gui.setup();
    gui.add(radius.setup("radius", 200, 0, 400));
    gui.add(color.setup("color", initColor, minColor, maxColor));
    gui.add(position.setup("position", initPos, minPos, maxPos));
}
particle::particle( ofxVec3f _pos, int _id, float _size, ofTexture _tex ) {
	
    ofSetCircleResolution(22);				// reduce circle res for performance
    
    texture = _tex;
	pos = _pos;								// get birth place from pixels
	pId = _id;
    size = _size;
    
    life = (int)ofRandom(10, 50);           // set particle life span
	initLife = life;

    vel = ofxVec3f(0,0,0);					// initiate velocity	
	acc = ofxVec3f(0,0,0);					// initiate acceleration
	damping = 1; //2; //0.05;
    
    myMask.loadImage("mask.tif");
	myMask.resize(size*2,size*2);

}
Example #19
0
void testApp::setup()
{
	ofSetFrameRate( 30 );							// OF setup.
	ofSetVerticalSync( true );
	ofSetCircleResolution( 100 );
	ofEnableSmoothing();
	ofBackground( 255, 255, 255 );
	
	
	stage = ofxFlashStage :: getInstance();			// ofxFlash setup.
	stage->addListeners();
	stage->showRedrawRegions( bShowRedrawRegions = false );

	
	xfl.loadFile( "assets/DOMDocument.xml" );		// load XFL flash file.
	xfl.build();
	
	
	stage->addChild( &instructions );				// add child to stage.
}
Example #20
0
//--------------------------------------------------------------
void ofApp::setup(){

    // setup mvp environment
    mvp.setup(this);

    ofHideCursor();
	ofSetVerticalSync(true);
	ofSetCircleResolution(80);
	ofBackground(54, 54, 54);	
	fbo.allocate(ofGetWidth(), ofGetHeight() );

    // Begin Plane suff
    ofSetVerticalSync(true);
    // GL_REPEAT for texture wrap only works with NON-ARB textures //
    ofDisableArbTex();
    texture.load("plane.png");
    texture.getTexture().setTextureWrap( GL_REPEAT, GL_REPEAT );
    // end Plane stuff 

}
Example #21
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(0);
    ofSetCircleResolution(64);
    ofEnableAlphaBlending();
    
    cam.initGrabber(ofGetWidth(), ofGetHeight());
    fbo.allocate(ofGetWidth(), ofGetHeight());
    
    for (int i = 0; i < NUM; i++) {
        location[i] = ofVec2f(ofRandom(ofGetWidth()), ofRandom(ofGetHeight()));
        velocity[i] = ofVec2f(ofRandom(-5, 5), ofRandom(-5, 5));
        radius[i] = ofRandom(2, 50);
    }
    
    bottomImg.loadImage("space.jpg");
    
    alphaMask = new ofxAlphaMaskTexture(cam.getTextureReference(),       // top layer texture
                                        bottomImg.getTextureReference(), // bottom layer texture
                                        fbo.getTextureReference());      // mask layer texture
}
Example #22
0
//--------------------------------------------------------------
void testApp::setup() {
	
	ofSetVerticalSync(true);
	ofBackgroundHex(0x333333);
	ofSetLogLevel(OF_LOG_NOTICE);
    
    loadColors();
    
    ofSetCircleResolution(200);
    
	numEmailsStart = 20;
    numCategories = 5;

    radius = 24;
    
    unitRadius = 80;

    xShift = 70;
    yShift = 10;
    
    saved = 0;
    trash = 0;
    
	box2d.init();
	box2d.setFPS(30.0);
    box2d.registerGrabbing();
    box2d.setGravity(-8,8);
    box2d.createBounds(0,0,ofGetWidth()+1000,ofGetHeight());
		

    
    for(int i=0; i<numCategories; i++) {
        resetAttractionPoints(numCategories);
    }
   
    // add email/circles to world
	for (int i=0; i < numEmailsStart; i++) {
        addEmail(i % numCategories);
        emails[i].setInitialConditions();
    }
}
Example #23
0
void ofxControlPanel::draw()
{
    if (!active) {
        return;
    }

    ofPushStyle();
    ofSetLineWidth(1);
    ofSetCircleResolution(16);

    ofxControlWidget::draw();
    
    if (!getCollapsed())
    {
        ofPushStyle();
        ofSetColor(255, 50);
        ofDrawRectangle(rectangle.x, rectangle.y + headerHeight, rectangle.width, controllerHeight);
        ofPopStyle();
        
        if (controlRow)
        {
            if (oscManagerMade) tOsc->draw();
            tSeq->draw();
            tXml->draw();
        }
        
        if (bOsc && oscManagerMade) {
            oscManager->draw();
        }

        if (bSeq && sequencerMade) {
            sequencer->draw();
        }
        
        if (bXml) {
            meta->draw();
        }
    }
    
    ofPopStyle();
}
Example #24
0
void StFftDot::draw() {
    app->drawFbo->fbo.begin();
    app->drawFbo->blendMode = 1;
    cam.begin();
    ofDisableAlphaBlending();
    ofClear(0,0,0);
    ofSetCircleResolution(64);
    ofxUISlider *gcirclesize = (ofxUISlider *)gui->getWidget("CIRCLE SIZE"); float circlesize = gcirclesize->getValue();
    ofxUIIntSlider *gskip = (ofxUIIntSlider *)gui->getWidget("SKIP"); int skip = gskip->getValue();
    ofxUIIntSlider *gsaturation = (ofxUIIntSlider *)gui->getWidget("SATURATION"); int saturation = gsaturation->getValue();
    ofxUISlider *gbrightness = (ofxUISlider *)gui->getWidget("BRIGHTNESS"); float brightness = gbrightness->getValue();
    ofxUIIntSlider *grep = (ofxUIIntSlider *)gui->getWidget("REPEAT"); int rep = grep->getValue();
    ofxUISlider *gshift = (ofxUISlider *)gui->getWidget("SHIFT"); float shift = gshift->getValue();
    ofxUISlider *gzoom = (ofxUISlider *)gui->getWidget("ZOOM"); float zoom = gzoom->getValue();
    
    ofScale(zoom, zoom);
    ofEnableBlendMode(OF_BLENDMODE_ADD);
    
    float controlRep = ofMap(app->oscControl->controlVal[4], 0, 127.0, 1.0, 120.0);
    int controlHue = ofMap(app->oscControl->controlVal[5], 0, 127, 0, 63);
    int hueLow = controlHue;
    int hueHigh = (controlHue + 255 - 63);
    
    for (int j = 0; j < controlRep; j++) {
        for (int i = 0; i < app->fft->drawBins.size(); i += skip) {
            float size = ofMap(app->fft->drawBins[i], 0, 1.0, 1, circlesize);
            float x = ofMap(i, 0, app->fft->drawBins.size(), 0, ofGetWidth()/2.0);
            float hue = ofMap(i, 0, app->fft->drawBins.size(), hueLow, hueHigh);
            ofColor col;
            col.setHsb(hue, saturation, brightness);
            ofSetColor(col);
            ofCircle(x, shift, size);
            ofCircle(-x, shift, size);
        }
        ofRotateZ(360.0 / controlRep);
    }
    
    ofDisableAlphaBlending();
    cam.end();
    app->drawFbo->fbo.end();
}
Example #25
0
void trxStoryHint::draw(){
    float width = startRadius;
    float height = (width/tapIcon.width)*tapIcon.height;
    
    
    ofPushStyle();
    ofPushMatrix();
    ofTranslate(position.x, position.y);
    
    ofEnableAlphaBlending();
    ofSetColor(255, 255, 255,150);
    ofSetLineWidth(lineWidth);
    ofSetCircleResolution(40);
    //tapIcon.draw(-width*(3.2/8.0), -height*(1.0/8.0),width,height);
    //tapIcon.draw(-width/2, -height/2,width,height);
    ofFill();
    ofSetColor(255, 255, 255,255);
    //ofCircle(0, 0, 6);
    
    ofNoFill();
     //ofCircle(0, 0, 8);
    if (radius > maxRadius) {
        radius = maxRadius;
    }
    if (radius <= startRadius+fadeInDistance) {
        color.a = ofMap(radius, startRadius, startRadius+fadeInDistance, 0, 200);
    }
    else{
        color.a = ofMap(radius, startRadius+fadeInDistance, maxRadius, 200, 0);
    }
    
    ofSetColor(color);
   
    
    ofCircle(0, 0, radius);
    
    ofDisableAlphaBlending();
    ofPopMatrix();
    ofPopStyle();
    
}
Example #26
0
void testApp::setup() {
	ofSetFrameRate(120);
	ofSetCircleResolution(64);
	ofSetLogLevel(OF_LOG_VERBOSE);
	
	logOverlay = ofPtr<LogOverlay>(new LogOverlay());
	ofSetLoggerChannel(logOverlay);
	
	ofXml xml;
	xml.load("settings.xml");
	for(int i = 0; i < xml.getNumChildren("sick"); i++) {
		xml.setTo("sick[" + ofToString(i) + "]");
		ofPtr<ofxSickGrabber> cur(new ofxSickGrabber());
		cur->setIp(xml.getValue("ip"));
		cur->setAngleOffset(xml.getValue<int>("angleOffset"));
		cur->setAngleRange(xml.getValue<int>("startAngle"), xml.getValue<int>("stopAngle"));
		cur->setup();
		sick.push_back(cur);
		xml.setToParent();
	}
}
Example #27
0
//--------------------------------------------------------------
void testApp::setup() {
    ofBackground(0, 0, 0); //背景色の設定
    ofSetFrameRate(60); //フレームレートの設定
    ofSetCircleResolution(64); //円の解像度設定
    ofEnableAlphaBlending(); //アルファチャンネルを有効に

    loc_x1 = ofRandom(0, ofGetWidth()); //円1のx座標初期位置
    loc_y1 = ofRandom(0, ofGetHeight()); //円1のy座標初期位置
    speed_x1 = ofRandom(-10, 10); //x軸方向スピード初期値1
    speed_y1 = ofRandom(-10, 10); //y軸方向スピード初期値1

    loc_x2 = ofRandom(0, ofGetWidth()); //円2のx座標初期位置
    loc_y2 = ofRandom(0, ofGetHeight()); //円2のy座標初期位置
    speed_x2 = ofRandom(-10, 10); //x軸方向スピード初期値2
    speed_y2 = ofRandom(-10, 10); //y軸方向スピード初期値2

    loc_x3 = ofRandom(0, ofGetWidth()); //円3のx座標初期位置
    loc_y3 = ofRandom(0, ofGetHeight()); //円3のy座標初期位置
    speed_x3 = ofRandom(-10, 10); //x軸方向スピード初期値3
    speed_y3 = ofRandom(-10, 10); //y軸方向スピード初期値3
}
//--------------------------------------------------------------
void testApp::setup(){
    
    serial.enumerateDevices();
    serial.setup(0,9600);
    
    ofSetVerticalSync(true);
//    ofSetFrameRate(30);

    ofSetWindowShape(800, 600);
    ofSetCircleResolution(100);
    ofBackground(255);
    
    x = 10;
    y = 10;
    z = 10;
    
    message = ("Reading one byte at a time");
    font.loadFont("liberationsans-bold-webfont.ttf", 20, true, false, true);

//    video.loadMovie("GoodHair_JFleurantin.mov");
}
//--------------------------------------------------------------
void ofApp::setup(){

	ofSetVerticalSync(true);
	ofBackground(ofColor::darkGray);
	ofSetWindowTitle("Noise");
	ofSetCircleResolution(50);

	// background grid circle size
	blueSize = 20;

	// start in the middle of the window
	greenPosY = ofGetHeight()/2;
	greenBaseX = ofGetWidth()/2;
	greenOffsetX = ofGetWidth()/2;
	greenNoiseX = 0;

	// start in the middle of the window
	redBaseX = ofGetWidth()/2;
	redBaseY = ofGetHeight()/2;
	redNoiseY = 0.025;
}
Example #30
0
void ofApp::setup() {
	ofSetWindowTitle("ScratchOSC");
	ofSetVerticalSync(true);
	ofSetDrawBitmapMode(OF_BITMAPMODE_MODEL_BILLBOARD);
	ofSetCircleResolution(50);
	ofSetLineWidth(2);
	
	loadSettings();
	oscRate = (audioSamplerate / audioBuffersize) / oscSubdivide;
	
	xwax.setup(audioSamplerate, audioBuffersize, recordFormat);
	ofSoundStreamSetup(0, 2, audioSamplerate, audioBuffersize, 1);
	
	osc.setup(oscHost, oscPort);
	
	serialReady = serial.setup(serialPort, 115200);
	
	middleAudioBuffer.resize(audioBuffersize * 2);
	frontAudioBuffer.resize(audioBuffersize * 2);
	audioFrame = 0;
}