|
Author |
Topic: fading pixel-line hack (Read 358 times) |
|
mKoser
|
fading pixel-line hack
« on: Mar 6th, 2004, 2:33pm » |
|
i used to be able to fade pixel-lines by drawing a semi-transperant rect on top of them... this got lost somewhere in the recent releases. just saw this post, regarding disabling the zBuffer. if you use the small hack fry provides there, the pixel-fading mechanism works again. online example here Code:// pixelLine_trail_tester [0068.2003.06.03] // mikkel crone koser // www.beyondthree.com // description: // by toggeling the state of g.depthTest, you // can switch the possibility of drawing with // alpha on top of a single pixel line. // (ie. creating creating a trail-effect) void setup(){ size(300, 300); background(255, 200, 0); } void loop(){ drawFader(); drawLine(); } void drawFader(){ noStroke(); fill(255, 200, 0, 30); rect(0, 0, width, height); } void drawLine(){ stroke(0, 0, 0); line(0, 0, mouseX, mouseY); } void mousePressed(){ g.depthTest = false; } void mouseReleased(){ g.depthTest = true; } |
| since there will be a new graphics-engine in a future release, this "hack" may only apply for rev. 0068. + mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
skloopy
|
Re: fading pixel-line hack
« Reply #1 on: Mar 9th, 2004, 6:48am » |
|
Is reason that the lines never completely fade to yellow because of the same rounding errors?
|
« Last Edit: Mar 9th, 2004, 6:48am by skloopy » |
|
|
|
|
|