How to make denser regions of the canvas brighter?

edited January 2014 in How To...

I'm scattering dots on the canvas and I would like the regions with more dots to appear brighter. What's a good way of achieving this? Thanks in advance for your help.

Tagged:

Answers

  • use a black canvas and light, semi-transparent dots - the more overlapping points you draw, the lighter it'll get.

  • I have the following code.

    void setup() {
      background(0);
      size(200, 200, P3D);
      noStroke();
    }
    
    void draw() {
      background(0);
      lights();
      fill(255,0,0,25);
      for (int i=0; i<5; i++) {
        ellipse(width/2-20,height/2,5,5);
      }
      for (int i=0; i<500; i++) {
        ellipse(width/2+20,height/2,5,5);
      }
    }
    

    Although indeed one dot appears more clearly, it's not the effect I'm looking for. I feel like this merely increases the total alpha in one location. The effect I'm trying to achieve is a "glowing" effect. How can I do that?

  • i think you'll probably need more white in the mix to make them glow. that'll mean using something more than just pure red.

Sign In or Register to comment.