digitypo
YaBB Newbies
Offline
Posts: 4
|
bugs for OPENGL and compiling?
Mar 14th, 2007, 4:22am
Hi, all. I am using the newest version and 0123beta. when I tried to make a simple image, I found strange things. I guess they might be bugs.
1. Trace I drew a simple image and then it should have disappeared by time pass, but It doesn't perfectly make clear background image. I mean I could see traces like this.
http://www.digitypo.com/data/3.gif
However, when I use OPENGL, it is disappeared.
2. a bug for window size? I put bigger than 300*300 for size of window, but it sometimes makes smaller than 300*300 when I use OPENGL.
http://www.digitypo.com/data/1.gif
3. when I use OPENGL, I can see a big grey noise and then never disappeared like this.
http://www.digitypo.com/data/2.gif
Here is the code!
import processing.opengl.*;
Particle ptcl;
void setup() { size(400, 400, OPENGL); //frameRate(30); noStroke(); ptcl = new Particle(); }
void draw() { //background(255, 255, 255); fill(0, 0, 0, 10); rect(0, 0, width, height); ptcl.Update(); ptcl.Draw(); }
class Particle { float x, y; float vx, vy; float dt; float radius; //float cr, cg, cb; //float ch, cs, cb; Particle() { x = random(width); y = random(height); vx = 0; vy = 0; dt = 0.01 + 0.04 * random(1); radius = 20 + random(20); } void Update() { vx += mouseX - x; vy += mouseY - y; x += vx * dt; y += vy * dt; vx *= 0.9; vy *= 0.9; } void Draw() { //stroke(255, 0, 0); fill(100, 20, 40, 200); ellipse(x, y, radius, radius); } }
|