[ Video ]
[ About ]
十字をくるくるさせているだけですが、意外と綺麗だったので。
[ Source ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#pragma once #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 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 48 49 50 |
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup() { ofSetFrameRate(60); ofBackground(39); ofSetWindowTitle("Insta"); ofSetLineWidth(5); } //-------------------------------------------------------------- void ofApp::update() { } //-------------------------------------------------------------- void ofApp::draw() { int span = 72; ofColor line_color; for (int x = span / 2; x < ofGetWidth() + span / 2; x += span) { for (int y = span / 2; y < ofGetHeight() + span / 2; y += span) { ofPoint point = ofPoint(x, y); ofPushMatrix(); ofTranslate(point); ofRotate(ofNoise(x * 0.005, y * 0.005, ofGetFrameNum() * 0.03) * 360); line_color.setHsb((x + y) % 255, 239, 239); ofSetColor(line_color); ofDrawLine(ofPoint(0, -span / 2), ofPoint(0, span / 2)); ofDrawLine(ofPoint(-span / 2, 0), ofPoint(span / 2, 0)); ofPopMatrix(); } } } //-------------------------------------------------------------- int main() { ofSetupOpenGL(720, 720, OF_WINDOW); ofRunApp(new ofApp()); } |