Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 39 lines (35 sloc) 0.976 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

  /**
* Debug function for drawing bounding boxes to the screen.
*/
  static void debugfunctions_drawBoundingBox(float[] bounds, PApplet sketch) {
    sketch.stroke(255,0,0);
    sketch.fill(0,50);
    sketch.beginShape();
    for(int i=0, last=bounds.length; i<last; i+=2) {
      sketch.vertex(bounds[i],bounds[i+1]);
    }
    sketch.endShape(CLOSE);
  }


  /**
* Draw a nice looking grid
*/
  void debugfunctions_drawBackground(float width, float height) {
    background(255,255,252);
    strokeWeight(1);
    fill(0);
    // fine grid
    stroke(235);
    float x, y;
    for (x = -width; x < width; x += 10) {
      line(x,-height,x,height); }
    for (y = -height; y < height; y += 10) {
      line(-width,y,width,y); }
    // coarse grid
    stroke(208);
    for (x = -width; x < width; x += 100) {
      line(x,-height,x,height); }
    for (y = -height; y < height; y += 100) {
      line(-width,y,width,y); }
    // reset to black
    stroke(0);
  }
Something went wrong with that request. Please try again.