Skip to content
Snippets Groups Projects
triangle16_dot.pde 688 B
Newer Older
  • Learn to ignore specific revisions
  • OPC opc;
    PImage dot;
    TriangleGrid triangle;
    
    void setup()
    {
      size(500, 400);
    
      // Load a sample image
      dot = loadImage("dot.png");
    
      // Connect to the local instance of fcserver
      opc = new OPC(this, "127.0.0.1", 7890);
    
      // Map our triangle grid to the center of the window
      triangle = new TriangleGrid();
      triangle.grid16();
      triangle.mirror();
      triangle.rotate(radians(60));
      triangle.scale(height * 0.2);
      triangle.translate(width * 0.5, height * 0.57);
      triangle.leds(opc, 0);
    }
    
    void draw()
    {
      background(0);
    
      // Draw the image, centered at the mouse location
      float dotSize = height * 0.7;
      image(dot, mouseX - dotSize/2, mouseY - dotSize/2, dotSize, dotSize);
    }