Skip to content

Commit 9807c8e

Browse files
committed
Fix Move Eye camera distance, add processing-web.png locally
1 parent b8a610e commit 9807c8e

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

assets/examples_js/Basics/camera/Move_Eye/Move_Eye.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ function setup() {
66
function draw() {
77
background(0);
88
lights();
9-
camera(30.0, mouseY - height / 2, 220.0,
10-
0.0, 0.0, 0.0,
11-
0.0, 1.0, 0.0);
9+
10+
// Map mouseY so moving mouse up lifts camera
11+
let eyeY = map(mouseY, 0, height, -200, 200);
12+
13+
camera(30, eyeY, 500, // eye — pushed back so box is fully visible
14+
0, 0, 0, // center
15+
0, 1, 0); // up
16+
1217
noStroke();
1318
box(90);
1419
stroke(255);

examples/move-eye.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@ <h1>Move Eye</h1>
7373
function draw() {
7474
background(0);
7575
lights();
76-
camera(30.0, mouseY - height / 2, 220.0,
77-
0.0, 0.0, 0.0,
78-
0.0, 1.0, 0.0);
76+
77+
// Map mouseY so moving mouse up lifts camera
78+
let eyeY = map(mouseY, 0, height, -200, 200);
79+
80+
camera(30, eyeY, 500, // eye — pushed back so box is fully visible
81+
0, 0, 0, // center
82+
0, 1, 0); // up
83+
7984
noStroke();
8085
box(90);
8186
stroke(255);

0 commit comments

Comments
 (0)