[ Video ]
[ About ]
円周上の2点を結ぶ線が85(255 / 3)本あります。また、線の濃さ(Alpha)はそれぞれ違っています。線が無い場所でも円の輪郭が見えてくる気がして面白いですね。
[ Source ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#include "ofMain.h" class ofApp : 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 mouseEntered(int x, int y) {}; void mouseExited(int x, int y) {}; void windowResized(int w, int h) {}; void dragEvent(ofDragInfo dragInfo) {}; void gotMessage(ofMessage msg) {}; }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup() { ofSetFrameRate(60); ofBackground(39); ofSetWindowTitle("Insta"); ofSetLineWidth(2); ofEnableBlendMode(ofBlendMode::OF_BLENDMODE_ADD); } //-------------------------------------------------------------- void ofApp::update() { ofSeedRandom(39); } //-------------------------------------------------------------- void ofApp::draw() { ofTranslate(ofGetWidth() / 2, ofGetHeight() / 2); float radius = 300; for (int i = 0; i < 255; i += 3) { ofSetColor(239, i); float deg_1 = ofRandom(360); deg_1 += ofMap(ofNoise((deg_1 + i) * 0.1, ofGetFrameNum() * 0.0005), 0, 1, -180, 180); float deg_2 = ofRandom(360); deg_2 += ofMap(ofNoise((deg_2 + i) * 0.1, ofGetFrameNum() * 0.0005), 0, 1, -180, 180); ofPoint point_1 = ofPoint(radius * cos(deg_1 * DEG_TO_RAD), radius * sin(deg_1 * DEG_TO_RAD)); ofPoint point_2 = ofPoint(radius * cos(deg_2 * DEG_TO_RAD), radius * sin(deg_2 * DEG_TO_RAD)); ofDrawLine(point_1, point_2); } } //-------------------------------------------------------------- int main() { ofSetupOpenGL(720, 720, OF_WINDOW); ofRunApp(new ofApp()); } |