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
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