We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › glitchP5 - a tiny library for visual glitches
Page Index Toggle Pages: 1
glitchP5 - a tiny library for visual glitches (Read 2925 times)
glitchP5 - a tiny library for visual glitches
Jan 26th, 2010, 7:24am
 
hello,

i am making a basic library for glitches (my first lib  Smiley). It is quite self-explanatory, just have a look at the example:

glitchP5

Currently there are only two methods:
run() and glitch().

run() needs to be called at the end of draw(), it does loadPixels()/updatePixels().

glitch() triggers a cascade of glitches. it takes 10 arguments and can be used to create glitches in a wide variety of styles  Cheesy
see the example for how to use.

couple questions:
is it possible to hide the call to run() somehow, and do it automatically at the end of draw()

is it possible that glitch() can be called just like a method of PApplet i.e.

Code:
glitch(arg0, arg1, ...) 


instead of

Code:
glitchP5.glitch(arg0, arg1, ...) 


?

any questions and feedback are welcome.
Re: glitchP5 - a tiny library for visual glitches
Reply #1 - Jan 26th, 2010, 12:22pm
 
See Hacks:registerevents

Basically: rename GlitchP5.run() to draw(), and in the constructor add:

Code:
parent.registerDraw(this); 



Now the glitchP5.draw() method (and anything else registerDraw()'ed) will be called after the sketch's draw() method.

I don't know what magic happens in Processing libraries, so can't help you at the moment with your second request.

I suppose one option is to make something like

class GlitchApplet extends PApplet { .. }

and put the glitchiness in there.

-spxl
Re: glitchP5 - a tiny library for visual glitches
Reply #2 - Jan 26th, 2010, 1:58pm
 
this is nice, exactly what i need for some upcoming party visuals Smiley
Re: glitchP5 - a tiny library for visual glitches
Reply #3 - Jan 26th, 2010, 4:17pm
 
good to hear   Smiley

thx subpixel it works… guess i should rtfm  Wink
Re: glitchP5 - a tiny library for visual glitches
Reply #4 - Feb 15th, 2010, 6:27pm
 
this is really cool. I noticed it breaks with draw on a transparent rect motion blur trick...anyway other way to have glitches with motion blur?
Page Index Toggle Pages: 1