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.
Page Index Toggle Pages: 1
Rotate (Read 941 times)
Rotate
May 8th, 2005, 4:23am
 
hi, i will apreciate if you can help me,
i need to have 2 elements separated that rotate in its own axis but one independent of the other
thanx
Re: Rotate
Reply #1 - May 8th, 2005, 5:20am
 
well, I'm not a trustworthy source for coding questions ( = newbie) but here it goes

Code:

float rotator;
void setup() {
size (300,300);
}
void draw() {
background(0);
translate(120,120);
rotate(rotator);
ellipse(0, 0, 40, 60);
resetMatrix();
translate(200,120);
rotate(rotator/2);
ellipse(0, 0, 75, 40);
rotator+=PI/128;
}
Page Index Toggle Pages: 1