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.
IndexSuggestions & BugsSoftware Bugs › java2d renderer and curveVertex()
Page Index Toggle Pages: 1
java2d renderer and curveVertex() (Read 901 times)
java2d renderer and curveVertex()
May 12th, 2005, 2:05am
 
there seems to be a bug in the curveVertex() function in the java2d renderer:

Code:


// not sure where this code originally came from ...
// anybody claims it? lunetta?

int counter;
int t; // time
float xa, xb, x, y; // coordinates
float wx, wy, ws; // frequencies
float px, py, ps; // phases
float d; //decay
float Ax, Ay, As; // Amplitudes

void setup()
{
//size (600,600, P3D);
size (600,600);

background(255);
t = 0;
d = 0.003;
counter = 0;
wx = 440;
wy = 440;
ws = 440;
px = 4;
py = 2;
ps = 3;
Ax = 250;
Ay= 250;
As = 250;
}

void draw()
{
beginShape(LINE_STRIP);
for(t=0;t<1200;t++)
{
Ax = Ax - Ax*d;
Ay = Ay - Ay*d;
As = As - As*d;
xa = Ax*sin(wx*t+px);
y = height/2 + Ay*sin(wy*t+py);
xb = As*sin(ws*t+ps);
x = width/2 + xa+xb;
//println("x: "+x+" y: "+y);
curveVertex(x,y);
}
endShape();
}


in java2d mode the spiral is draw incorrect. OPENGL and P3D both work fine.

F
Re: java2d renderer and curveVertex()
Reply #1 - May 12th, 2005, 7:40am
 
found and fixed for 91.
Page Index Toggle Pages: 1