#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
Upcoming SlideShare
Loading in …5
×

Sbaw090519

4,135
-1

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,135
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
34
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide









































  • 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); } } ... ( )

    ×