Created
July 1, 2016 19:33
-
-
Save ofZach/8ac041d239b83735976463938f527874 to your computer and use it in GitHub Desktop.
leaving the grid sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
ofEasyCam cam; | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::update(){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::draw(){ | |
ofBackground(0); | |
ofSetColor(255); | |
cam.begin(); | |
ofRotate(mouseX, 0,1,0); | |
ofPoint camPt = cam.getPosition(); | |
ofSeedRandom(0); | |
for (int i = -20; i < 20; i++){ | |
for (int j = -20; j < 20; j++){ | |
ofPoint a = ofPoint(i*20, j*20); | |
ofPoint b = ofPoint((i+1)*20, j*20); | |
ofPoint c = ofPoint((i+1)*20, (j+1)*20); | |
ofPoint d = ofPoint(i*20, (j+1)*20); | |
a = (a - cam.getPosition()).getNormalized(); | |
b = (b - cam.getPosition()).getNormalized(); | |
c = (c - cam.getPosition()).getNormalized(); | |
d = (d - cam.getPosition()).getNormalized(); | |
ofDrawLine(camPt + a*ofRandom(700,800), camPt + b*ofRandom(700,800)); | |
ofDrawLine(camPt + b*ofRandom(700,800), camPt + c*ofRandom(700,800)); | |
ofDrawLine(camPt + c*ofRandom(700,800), camPt + d*ofRandom(700,800)); | |
ofDrawLine(camPt + d*ofRandom(700,800), camPt + a*ofRandom(700,800)); | |
} | |
} | |
cam.end(); | |
} | |
//-------------------------------------------------------------- | |
void ofApp::keyPressed(int key){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::keyReleased(int key){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mouseMoved(int x, int y ){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mouseDragged(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mousePressed(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mouseReleased(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mouseEntered(int x, int y){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::mouseExited(int x, int y){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::windowResized(int w, int h){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::gotMessage(ofMessage msg){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::dragEvent(ofDragInfo dragInfo){ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment