int size = 40;
float degree;
PVector location;
void setup() {
frameRate(60);
smooth();
background(255);
radius = height / 4.0;
location = new PVector(0, 0);
degree = 0.0;
velocity = 1.0;
}
void draw() {
translate(width / 2, height / 2);
location.x = cos(radians(degree)) * radius;
location.y = sin(radians(degree)) * radius;
ellipse(location.x, location.y, size, size);
degree += velocity;
int size = 40;
float degree;
PVector location;
void setup() {
frameRate(60);
smooth();
background(255);
radius = height / 4.0;
location = new PVector(0, 0);
degree = 0.0;
velocity = 1.0;
}
void draw() {
background(255);
translate(width / 2, height / 2);
location.x = cos(radians(degree)) * radius;
location.y = sin(radians(degree)) * radius;
ellipse(location.x, location.y, size, size);
degree += velocity;
}
サンプルプログラム