Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
#import quot;GraphView.hquot;

// AppDelegate class interface.

@interface AppDelegate : NSObject <UIAccelerometerDelegate...
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
}

/...
#ifndef _TEST_APP
#define _TEST_APP



#include quot;ofMain.hquot;

class testApp : public ofBaseApp{
	
public:
	 void set...
#include quot;testApp.hquot;            void testApp::draw(){
                                	   //
void testApp::setup()...
#ifndef _TEST_APP
#define _TEST_APP
#include quot;ofMain.hquot;
#define BALL_NUM 100
class testApp : public ofBaseApp{
pub...
#include quot;testApp.hquot;
//--------------------------------------
void testApp::setup(){
	   ofBackground(0,0,0);
	   ...
//--------------------------------------
void testApp::draw(){
	 for(int i = 0; i < BALL_NUM; i++){
	 	      //
	   	   of...
#ifndef _TEST_APP
#define _TEST_APP
#include quot;ofMain.hquot;
#define BALL_NUM 100
class testApp : public ofBaseApp{
pub...
#include quot;testApp.hquot;
//--------------------------------------
void testApp::setup(){
	   ofBackground(0,0,0);
	   ...
//--------------------------------------
void testApp::draw(){
	 for(int i = 0; i < BALL_NUM; i++){
	 	      //
	   	   of...
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
Sbaw090519
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Sbaw090526
Next
Upcoming SlideShare
Sbaw090526
Next
Download to read offline and view in fullscreen.

Share

Sbaw090519

Download to read offline

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Sbaw090519

  1. 1. #import quot;GraphView.hquot; // AppDelegate class interface. @interface AppDelegate : NSObject <UIAccelerometerDelegate> { IBOutlet UIWindow *window; IBOutlet GraphView *graphView; IBOutlet UIToolbar *toolbar; } @property (nonatomic, retain) UIWindow *window; @property (nonatomic, retain) GraphView *graphView; @property (nonatomic, retain) UIToolbar *toolbar; - (IBAction)toggleRun:(id)sender; - (IBAction)toggleFiltering:(id)sender;
  2. 2. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ } //-------------------------------------------------------------- void testApp::update(){ } //-------------------------------------------------------------- void testApp::draw(){ // ofSetColor(63, 127, 255); // ofCircle(ofGetWidth() / 2, ofGetHeight() / 2, 100); }
  3. 3. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); ... ( ) ... private: float posX, posY; float speedX, speedY; }; #endif
  4. 4. #include quot;testApp.hquot; void testApp::draw(){ // void testApp::setup(){ ofSetColor(63, 127, 255); ofBackground(0,0,0); // posX = ofGetWidth() / 2; posY = ofGetHeight() / 2; ofCircle(posX, posY, 100); speedX = ofRandom(-5, 5); } speedY = ofRandom(-5, 5); } void testApp::update(){ posX += speedX; if(posX < 0 || posX > ofGetWidth()){ speedX *= -1; } posY += speedY; if(posY < 0 || posY > ofGetHeight()){ speedY *= -1; } }
  5. 5. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; #define BALL_NUM 100 class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); private: float posX[BALL_NUM], posY[BALL_NUM]; float speedX[BALL_NUM], speedY[BALL_NUM]; }; #endif
  6. 6. #include quot;testApp.hquot; //-------------------------------------- void testApp::setup(){ ofBackground(0,0,0); for(int i = 0; i < BALL_NUM; i++){ posX[i] = ofGetWidth() / 2; posY[i] = ofGetHeight() / 2; speedX[i] = ofRandom(-1, 1); speedY[i] = ofRandom(-1, 1); } } //-------------------------------------- void testApp::update(){ for(int i = 0; i < BALL_NUM; i++){ posX[i] += speedX[i]; if(posX[i] < 0 || posX[i] > ofGetWidth()){ speedX[i] *= -1; } posY[i] += speedY[i]; if(posY[i] < 0 || posY[i] > ofGetHeight()){ speedY[i] *= -1; } } }
  7. 7. //-------------------------------------- void testApp::draw(){ for(int i = 0; i < BALL_NUM; i++){ // ofSetColor(63, 127, 255); // ofCircle(posX[i], posY[i], 20); } } ... ( )
  8. 8. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; #define BALL_NUM 100 class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); private: float posX[BALL_NUM], posY[BALL_NUM]; float speedX[BALL_NUM], speedY[BALL_NUM]; }; #endif
  9. 9. #include quot;testApp.hquot; //-------------------------------------- void testApp::setup(){ ofBackground(0,0,0); for(int i = 0; i < BALL_NUM; i++){ posX[i] = ofGetWidth() / 2; posY[i] = ofGetHeight() / 2; speedX[i] = ofRandom(-1, 1); speedY[i] = ofRandom(-1, 1); } } //-------------------------------------- void testApp::update(){ for(int i = 0; i < BALL_NUM; i++){ posX[i] += speedX[i]; if(posX[i] < 0 || posX[i] > ofGetWidth()){ speedX[i] *= -1; } posY[i] += speedY[i]; if(posY[i] < 0 || posY[i] > ofGetHeight()){ speedY[i] *= -1; } } }
  10. 10. //-------------------------------------- void testApp::draw(){ for(int i = 0; i < BALL_NUM; i++){ // ofSetColor(63, 127, 255); // ofCircle(posX[i], posY[i], 20); } } ... ( )
  • wilmmatsunaga

    Dec. 7, 2017
  • ShoYamaguchi4

    Sep. 2, 2016
  • m0Rya

    Sep. 30, 2014

Views

Total views

4,594

On Slideshare

0

From embeds

0

Number of embeds

3,514

Actions

Downloads

36

Shares

0

Comments

0

Likes

3

×