mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Examples updates to 640 x 360 pixels
This commit is contained in:
@@ -10,10 +10,10 @@ EggRing er1, er2;
|
||||
|
||||
|
||||
void setup() {
|
||||
size(200, 200);
|
||||
size(640, 360);
|
||||
smooth();
|
||||
er1 = new EggRing(66, 132, 0.1, 66);
|
||||
er2 = new EggRing(132, 180, 0.05, 132);
|
||||
er1 = new EggRing(width*0.45, height*0.5, 0.1, 120);
|
||||
er2 = new EggRing(width*0.65, height*0.8, 0.05, 180);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class Egg {
|
||||
float scalar; // Height of the egg
|
||||
|
||||
// Constructor
|
||||
Egg(int xpos, int ypos, float t, float s) {
|
||||
Egg(float xpos, float ypos, float t, float s) {
|
||||
x = xpos;
|
||||
y = ypos;
|
||||
tilt = t;
|
||||
@@ -33,4 +33,4 @@ class Egg {
|
||||
endShape();
|
||||
popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ class EggRing {
|
||||
Egg ovoid;
|
||||
Ring circle = new Ring();
|
||||
|
||||
EggRing(int x, int y, float t, float sp) {
|
||||
EggRing(float x, float y, float t, float sp) {
|
||||
ovoid = new Egg(x, y, t, sp);
|
||||
circle.start(x, y - sp/2);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
class Ring {
|
||||
|
||||
float x, y; // X-coordinate, y-coordinate
|
||||
float diameter; // Diameter of the ring
|
||||
boolean on = false; // Turns the display on and off
|
||||
|
||||
void start(float xpos, float ypos) {
|
||||
x = xpos;
|
||||
y = ypos;
|
||||
on = true;
|
||||
diameter = 1;
|
||||
}
|
||||
|
||||
void grow() {
|
||||
if (on == true) {
|
||||
diameter += 0.5;
|
||||
@@ -16,6 +19,7 @@ class Ring {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void display() {
|
||||
if (on == true) {
|
||||
noFill();
|
||||
|
||||
Reference in New Issue
Block a user