|
Author |
Topic: bug or nice effect? (Read 514 times) |
|
[m]
|
bug or nice effect?
« on: Oct 17th, 2003, 12:47am » |
|
void setup(){ size(300, 300); noStroke(); } float x; float y; void loop(){ x += (mouseX-x)/15; y += (mouseY-y)/15; fill(255);// fill(colour) push(); translate(x, y, 0); rotateY(x/50.0); rotateX(y/50.0); box(50); pop(); fill(0, 100);// fill(colour, alpha) rect(0,0,width,height); } In short, it will draw a box that follows the mouse and rotates depending on the mouseposistion. Well, that what it's supposed to do. It does the drawing bit nicely, but when you go around the edges of the applet, some wierd thing happen like the side of the gets a gray color and previous drawn boxes seem to shrink. :S It scares me. I guess it has something to do with interpreting the fill()'s not correctly, but it is still a strange effect. So, is it a bug or did I do something wrong? [edit] void setup(){ size(300, 300); noStroke(); } float x; float y; void loop(){ x += (mouseX-x)/15; y += (mouseY-y)/15; fill(255,100); // fill(colour, alpha) push(); translate(x, y, 0); rotateY(x/50.0); rotateX(y/50.0); box(50); pop(); fill(0,100); // fill(colour, alpha) rect(0,0,width,height); } But when I give the first fill() an alpha parameter, everything's fine again. [/edit]
|
« Last Edit: Oct 17th, 2003, 12:56am by [m] » |
|
|
|
|
Jerronimo
|
Re: bug or nice effect?
« Reply #1 on: Oct 19th, 2003, 1:04pm » |
|
that is a really strange, interesting effect in your first exaple. I'm not really sure what's going on there...
|
|
|
|
|