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.
IndexProgramming Questions & HelpPrograms › strange rotation
Page Index Toggle Pages: 1
strange rotation? (Read 405 times)
strange rotation?
Nov 8th, 2005, 5:15pm
 
Hello,

rotating a line around the origin:
version B  works fine, A doesn't
(v91/osx)

any thoughts?

thanks,
ana


// VERSION A

void setup() {
 size(400, 400);
 stroke(0,10);
}

float rad = 0.0;

void draw() {
 translate(width/2, width/2);
 rotate(rad);
 line(0, 0, 0, -width/2);
 rad += 0.01;
}


// VERSION B

void setup() {
 size(400, 400, P3D);
 stroke(0,10);
}

float rad = 0.0;

void draw() {
 translate(width/2, width/2);
 rotateZ(rad);
 line(0, 0, 0, -width/2);
 rad += 0.01;
}
Page Index Toggle Pages: 1