Loading...
Logo
Processing Forum

Static Glowing Animation

in General Discussion  •  Other  •  5 months ago  
Hello Everyone,

I'm trying to make a static (in place) glowing animation for ellipse (static glowing animation like this, but with basic shapes not gif). For the glowing effect, I have found something close in this post. However, it will also blur the background. Is there a way to reset the filter?

I "think" what I need is draw (and not draw) the glowing object behind the actual object to make it seems like it's glowing. I checked out all the animation packages on the processing website, it seems like Ani can cycle through the glowing object repeated to create what I want. Does this sound like a reasonable approach? Any pointers on this would be much appreciated!

Thanks in advance.

Cheers,
Betty





Replies(2)

You could use a transparent PGraphics to isolate the glowing shape.

Code Example
Copy code
  1. PGraphics pg;
  2.  
  3. void setup(){
  4.   size(200,200);
  5.   fill(0, 0, 255);
  6.   noStroke();
  7.   smooth();
  8.   pg = createGraphics(width, height, JAVA2D);
  9.   pg.beginDraw();
  10.   pg.smooth();
  11.   pg.background(255, 0);
  12.   pg.noStroke();
  13.   pg.fill(255,0,0);
  14.   pg.ellipse(100,100,95,95);
  15.   pg.filter( BLUR, 6 );
  16.   pg.fill(255,255,0);
  17.   pg.ellipse(100,100,90,90);
  18.   pg.endDraw();
  19. }
  20.  
  21. void draw(){
  22.   background(255);
  23.   ellipse(mouseX, mouseY, 100, 100);
  24.   image(pg, 0, 0);
  25. }
Thanks amnon.owed! This works great for the glowing part!