Skip to content

Instantly share code, notes, and snippets.

@thraxil thraxil/layout.cpp
Created Jun 26, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.