Skip to content

Commit 15a6305

Browse files
committed
Fix Rotate Push Pop lighting
1 parent 130c1de commit 15a6305

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

assets/examples_js/Basics/transform/Rotate_Push_Pop/Rotate_Push_Pop.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ function setup() {
99

1010
function draw() {
1111
background(0, 0, 26);
12-
ambientLight(60);
13-
directionalLight(255, 255, 255, 0, 0, -1);
12+
ambientLight(100);
13+
directionalLight(255, 255, 255, 0.5, 0.5, -1);
1414
for (let i = 0; i < num; i++) {
1515
let gray = map(i, 0, num - 1, 0, 255);
1616
push();
1717
fill(gray);
1818
rotateY(a + offset * i);
1919
rotateX(a / 2 + offset * i);
20-
translate(0, 0, -50 * i);
21-
box(100);
20+
box(90);
2221
pop();
2322
}
2423
a += 0.01;

examples/rotate-push-pop.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ <h1>Rotate Push Pop</h1>
7979
8080
function draw() {
8181
background(0, 0, 26);
82-
lights();
82+
ambientLight(100);
83+
directionalLight(255, 255, 255, 0.5, 0.5, -1);
8384
for (let i = 0; i < num; i++) {
8485
let gray = map(i, 0, num - 1, 0, 255);
8586
push();
8687
fill(gray);
8788
rotateY(a + offset * i);
8889
rotateX(a / 2 + offset * i);
89-
box(100);
90+
box(90);
9091
pop();
9192
}
9293
a += 0.01;

0 commit comments

Comments
 (0)