openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B

on

  • 9,989 views

 

Statistics

Views

Total Views
9,989
Views on SlideShare
5,983
Embed Views
4,006

Actions

Likes
7
Downloads
105
Comments
0

21 Embeds 4,006

http://yoppa.org 1953
http://fumit.blogspot.jp 1793
http://fumit.blogspot.com 201
http://fumit.blogspot.fr 18
http://webcache.googleusercontent.com 9
http://fumit.blogspot.de 4
http://fumit.blogspot.tw 4
http://fumit.blogspot.sg 4
http://fumit.blogspot.kr 3
http://www.fumit.blogspot.jp 2
http://translate.googleusercontent.com 2
http://fumit.blogspot.ca 2
http://fumit.blogspot.it 2
http://fumit.blogspot.co.uk 2
http://fumit.blogspot.com.ar 1
http://feeds.feedburner.com 1
http://www.fumit.blogspot.de 1
http://www.fumit.blogspot.com 1
https://twimg0-a.akamaihd.net 1
https://www.google.co.jp 1
http://plus.url.google.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B Presentation Transcript

  • 1. ‣‣‣‣‣‣‣
  • 2. ‣‣ setup( ) update( ) draw( )
  • 3. ‣‣ setup( ) update( ) draw( )
  • 4. ‣‣ setup( ) update( ) draw( )
  • 5. ‣‣ setup( ) update( ) draw( )
  • 6. ‣‣ setup( ) update( ) draw( )
  • 7. ‣‣‣
  • 8. ‣‣‣‣‣‣
  • 9. ‣#pragma once#include "ofMain.h"class testApp : public ofBaseApp{!public:! void setup();! void update();! void draw();!! ofVec2f pos; // ( )};
  • 10. ‣#pragma once#include "ofMain.h"class testApp : public ofBaseApp{!public:! void setup();! void update();! void draw();!! ofVec2f pos; // ( )}; setup, update, draw
  • 11. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! // 60 (fps)! ofBackgroundHex(0x000000); //! //! pos.x = ofGetWidth()/2;! pos.y = ofGetHeight()/2;}void testApp::update(){! //! pos.x += 4.0; //pos.x = pos.x + 3.0! pos.y += 3.0; //pos.y = pos.y + 4.0}void testApp::draw(){! ofSetHexColor(0x3399ff); //! ofCircle(pos.x, pos.y, 20);! //}
  • 12. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! // 60 (fps)! ofBackgroundHex(0x000000); //! //! pos.x = ofGetWidth()/2;! pos.y = ofGetHeight()/2;}void testApp::update(){! //! pos.x += 4.0; //pos.x = pos.x + 3.0! pos.y += 3.0; //pos.y = pos.y + 4.0}void testApp::draw(){! ofSetHexColor(0x3399ff); //! ofCircle(pos.x, pos.y, 20);! //}
  • 13. ‣
  • 14. ‣ ‣ ofGetWidth() 0ofGetHeight()
  • 15. ‣‣‣‣‣‣‣‣‣
  • 16. ‣‣if ( ) {}
  • 17. ‣if (pos.x > ofGetWidth()) {pos.x = 0;} //if (pos.x < 0) {pos.x = ofGetWidth();} //if (pos.y > ofGetHeight()) {pos.y = 0;} //if (pos.y < 0) {pos.y = ofGetHeight();} //
  • 18. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! ofBackgroundHex(0x000000);! pos.x = ofGetWidth()/2;! pos.y = ofGetHeight()/2;}void testApp::update(){! pos.x += 4.0;! pos.y += 3.0;! if (pos.x > ofGetWidth()) {pos.x = 0;} //! if (pos.x < 0) {pos.x = ofGetWidth();} //! if (pos.y > ofGetHeight()) {pos.y = 0;} //! if (pos.y < 0) {pos.y = ofGetHeight();} //}void testApp::draw(){! ofSetHexColor(0x3399ff);! ofCircle(pos.x, pos.y, 20);}
  • 19. ‣
  • 20. ‣‣‣
  • 21. ‣‣ (0, 0)
  • 22. ‣‣ (0, 0)
  • 23. ‣‣‣
  • 24. ‣‣‣‣
  • 25. ‣#pragma once#include "ofMain.h"class testApp : public ofBaseApp{!public:! void setup();! void update();! void draw();!! float angle; //};
  • 26. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! // 60 (fps)! ofBackgroundHex(0x000000); //! //! ofSetRectMode(OF_RECTMODE_CENTER);}void testApp::update(){! angle += 10; //}void testApp::draw(){! //! ofTranslate(ofGetWidth()/2, ofGetHeight()/2);! ofRotateZ(angle); //! //! ofSetHexColor(0x3399ff);! ofRect(0, 0, 200, 200);}
  • 27. ‣
  • 28. ‣‣‣‣‣
  • 29. ‣#pragma once#include "ofMain.h"class testApp : public ofBaseApp{!public:! void setup();! void update();! void draw();!! float angle; //};
  • 30. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! // 60 (fps)! ofSetVerticalSync(true); //! ofBackgroundHex(0x000000); //! ofEnableBlendMode(OF_BLENDMODE_ADD);//}void testApp::update(){! angle += 10; //}
  • 31. ‣void testApp::draw(){! //! ofTranslate(ofGetWidth()/2, ofGetHeight()/2);! ofRotateZ(angle); //! ofPushMatrix(); //!! // 1! ofSetHexColor(0xff0000);! ofCircle(80, 0, 100);! ofRotateZ(120); //! // 2! ofSetHexColor(0x00ff00);! ofCircle(80, 0, 100);! ofRotateZ(120); //! // 3! ofSetHexColor(0x0000ff);! ofCircle(80, 0, 100);!! ofPopMatrix(); //}
  • 32. ‣
  • 33. ‣‣‣
  • 34. ‣#include "testApp.h"void testApp::setup(){! ofSetFrameRate(60);! // 60 (fps)! ofSetVerticalSync(true); //! ofBackgroundHex(0x000000); //! ofEnableBlendMode(OF_BLENDMODE_ADD);//! ofSetCircleResolution(64); //}void testApp::update(){! angle += mouseY / 4.0; // Y}
  • 35. ‣void testApp::draw(){! //! ofTranslate(ofGetWidth()/2, ofGetHeight()/2);! ofRotateZ(angle); //! ofPushMatrix(); //!! // 1! ofSetHexColor(0xff0000);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);! ofRotateZ(120); //! // 2! ofSetHexColor(0x00ff00);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);! ofRotateZ(120); //! // 3! ofSetHexColor(0x0000ff);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);!! ofPopMatrix(); //}
  • 36. ‣
  • 37. ‣‣
  • 38. ‣‣‣
  • 39. ‣void testApp::draw(){! //! ofTranslate(ofGetWidth()/2, ofGetHeight()/2);! ofRotateX(mouseY);! ofRotateZ(angle);! ofPushMatrix();! ofSetHexColor(0xff0000);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);! ofRotateZ(120);! ofSetHexColor(0x00ff00);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);! ofRotateZ(120);! ofSetHexColor(0x0000ff);! ofCircle(mouseX / 3.0, 0, 300 - mouseX / 6.0);!! ofPopMatrix();}
  • 40. ‣
  • 41. ‣‣‣‣‣‣