Skip to content

Commit f8c4c83

Browse files
committed
moving description from pde file to the js file
1 parent f06b6c6 commit f8c4c83

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

content/examples/Basics/Color/ColorVariables/ColorVariables.pde

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* in the program by a name, rather than a number.
66
*/
77

8-
9-
describe('There are two sets of squares. The first set contains three squares of varying sizes stacked together. The color of the smallest square is orange, the color of the middle square is gold, and the color of the biggest square is brown. On the right of the first set is the second set, which is similar to the first. The only difference here is the color of the squares; the smallest square is gold, the middle square is brown, and the biggest square is orange.')
10-
118
size(640, 360);
129
noStroke();
1310
background(51, 0, 0);

content/examples/Basics/Color/ColorVariables/liveSketch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ function runLiveSketch(s) {
2121
//color middle = #CC9900;
2222
//color outside = #993300;
2323

24+
s.describe(
25+
'There are two sets of squares. The first set contains three squares of varying sizes stacked together. The color of the smallest square is orange, the color of the middle square is gold, and the color of the biggest square is brown. On the right of the first set is the second set, which is similar to the first. The only difference here is the color of the squares; the smallest square is gold, the middle square is brown, and the biggest square is orange.'
26+
);
27+
2428
s.push();
2529
s.translate(80, 80);
2630
s.fill(outside);

content/examples/Basics/Lights/Directional/Directional.pde

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111

1212
void setup() {
13-
14-
describe('there are two dark spheres side by side ,the cursor works like a light source ,when mouse moves the direction of light changes and reveals some part of spheres.')
15-
1613
size(640, 360, P3D);
1714
noStroke();
1815
fill(204);
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
function runLiveSketch(s) {
2-
32
s.setup = () => {
43
s.createCanvas(640, 360, s.WEBGL);
54
s.noStroke();
65
s.fill(204);
76
};
87

98
s.draw = () => {
10-
s.noStroke();
11-
s.background(0);
9+
s.noStroke();
10+
s.background(0);
1211
let dirY = (s.mouseY / s.height - 0.5) * 2;
1312
let dirX = (s.mouseX / s.width - 0.5) * 2;
14-
s.directionalLight(204, 204, 204, -dirX, -dirY, -1);
15-
s.translate(- 100, 0, 0);
16-
s.sphere(80);
17-
s.translate(200, 0, 0);
18-
s.sphere(80);
13+
s.directionalLight(204, 204, 204, -dirX, -dirY, -1);
14+
s.translate(-100, 0, 0);
15+
s.sphere(80);
16+
s.translate(200, 0, 0);
17+
s.sphere(80);
18+
describe(
19+
'there are two dark spheres side by side, the cursor works like a light source, when mouse moves the direction of light changes and reveals some part of spheres.'
20+
);
1921
};
2022
}

0 commit comments

Comments
 (0)