Skip to content

Commit

Permalink
tune params
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahilea committed Apr 2, 2024
1 parent ef7224d commit 28bafa4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Binary file modified projects/wonderful-world/earth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions projects/wonderful-world/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ <h4><a href="../../index.html">@hannahilea</a> > <a href="../../projects.html">p
</nav>
<details>
<summary>Details</summary>
<p>Adapated from [a creative coding excercise](https://editor.p5js.org/hannahilea/sketches/AWA1W-c3H) (prompt:
<i>What a wonderful world</i>),
<p>Adapated from <a href="https://editor.p5js.org/hannahilea/sketches/AWA1W-c3H">a creative coding excercise</a>
(prompt:
<i>What a wonderful world</i>)
co-created with David Brooks while at the <a href="www.recurse.com">Recurse Center</a>.
Image <a
href="https://visibleearth.nasa.gov/images/76487/june-blue-marble-next-generation">via
NASA</a>.
href="https://visibleearth.nasa.gov/images/73826/october-blue-marble-next-generation-w-topography-and-bathymetry">via
NASA</a>. UX consult by Alex Ferguson.
</p>
<p><i>Usage:</i> Click anywhere on the Earth to play/pause the audio. Move the mouse around your screen during
playback. May not work on phone.</p>
Expand Down
10 changes: 4 additions & 6 deletions projects/wonderful-world/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
// https://editor.p5js.org/hannahilea/sketches/AWA1W-c3H

let angle = 0;
let earthSize = 200;
let earthImg;

let mySound;
function preload() {
soundFormats('mp3');
mySound = loadSound('world.mp3');
earthImg = loadImage('earth3.jpeg');
earthImg = loadImage('earth.jpg');
}

function setup() {
Expand Down Expand Up @@ -39,9 +38,8 @@ function draw() {
spinAmt = 0;
} else if (mouseY < height / 2) {
spinAmt = map(mouseY, 0, height, 0.001, 0.03, true)
// console.log(spinAmt);
} else {
spinAmt = map(mouseY - height / 2, 0, height, 0.02, 0.5);
spinAmt = map(mouseY - height / 2, 0, height, 0.02, 0.3);
}
pan = map(mouseX, 0, width, -1., 1.);

Expand All @@ -64,9 +62,9 @@ function draw() {
noStroke();
angle += spinAmt;
texture(earthImg);
sphere(earthSize);
sphere(windowHeight * .35);

// Update our audio
// Update audio
mySound.rate(rate);
mySound.pan(pan);
}

0 comments on commit 28bafa4

Please sign in to comment.