Skip to content

Instantly share code, notes, and snippets.

@thraxil
Created June 26, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thraxil/a5114c5878cf10c4f183a6f15b88de3a to your computer and use it in GitHub Desktop.
Save thraxil/a5114c5878cf10c4f183a6f15b88de3a to your computer and use it in GitHub Desktop.
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