Created
June 26, 2017 22:09
-
-
Save thraxil/a5114c5878cf10c4f183a6f15b88de3a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void ofApp::draw(){ | |
ofSetColor(ofColor::white); | |
ofNoFill(); | |
const int size = 20; | |
const int qs[7] = {0, 1, -1, 0, 1, -1, 0}; | |
const int rs[7] = {-1, -1, 0, 0, 0, 1, 1}; | |
for (int i = 0; i < 7; i++) { | |
int q = qs[i]; | |
int r = rs[i]; | |
double x = (sqrt(3.0) * q + (sqrt(3.0) / 2.0) * r) * size; | |
double y = (3.0 / 2.0) * r * size; | |
ofDrawCircle(x + center_p.x, y + center_p.y, size); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment