How to create a blob detection with an sphere following the blob.

Hello, I need help to create code with a blob detection with an sphere following the blob or a circle detection with an sphere following the circle. Is it possible for you to help? If you are interested in helping, I can elaborate further. I'm new to coding in processing.

Tagged:

Answers

  • @TfGuy44 Yes, I did look at that. Can you help me to get a sphere instead of a rect?

  • edited May 2017 Answer ✓

    See, "How do I draw a sphere at a given position?" is a MUCH easier question than "How do I do blob detection?". We're talking way, WAY easier here.

    void setup(){
      size(400,400,P3D);
      ortho();
    }
    
    void draw(){
      background(0);
      // Set your own (x,y) however you like - maybe with blob detection.
      float x = mouseX;
      float y = mouseY;
      // Draw sphere at (x,y)
      pushMatrix();
      lights();
      translate(x,y);
      scale(30);
      fill(255,0,0);
      noStroke();
      sphere(1);
      popMatrix();
    }
    
  • @TfGuy44 Thank you! I'll try to use this.

Sign In or Register to comment.