Skip to content

Commit

Permalink
Merge pull request #55 from lento234/art-fullscreen
Browse files Browse the repository at this point in the history
art fullscreen
  • Loading branch information
lento234 authored Sep 23, 2022
2 parents 520f4d3 + b927251 commit 3f5c218
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
23 changes: 7 additions & 16 deletions docs/art/brownian_motion/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,25 @@
// Date: 22.09.2022

// Global variables
const width = 600;
const height = 600;

const xmid = width / 2;
const ymid = height / 2;

const n_particles = 100;

let p = [];

function setup() {
let canvas = createCanvas(width, height);
let canvas = createCanvas(windowWidth, windowHeight);
canvas.parent("canvas");

let n_particles = int(windowHeight * windowHeight * 0.001);
for (let i = 0; i < n_particles; i++) {
let x = random(width);
let y = random(height);
let dx = random(-5, 5);
let dy = random(-5, 5);
let x = random(windowWidth);
let y = random(windowHeight);
let dx = random(-10, 10);
let dy = random(-10, 10);
let size = random(1, 5);
p.push(new Point(x, y, dx, dy, size));
}

}

function draw() {
clear();
for (let i=0; i < n_particles; i++) {
for (let i=0; i < p.length; i++) {
p[i].move();
p[i].draw();
}
Expand Down
15 changes: 8 additions & 7 deletions docs/art/fibonacci_sphere/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
// Based on Game of Life by Joan Soler-Adillon.

// Global variables
const width = 600;
const height = width;

const xmid = width / 2;
const ymid = height / 2;
let width, height, xmid, ymid, multiplier;

const size = 3;
const PI = Math.PI;
const GA = (3 - Math.sqrt(5)) * PI;

let N = 100;
let factor = 1;
let multiplier = width / 2 - 10;

function setup() {
let canvas = createCanvas(width, height);
width = Math.min(windowWidth, windowHeight);
height = width;
xmid = windowWidth/2;
ymid = windowHeight/2;
multiplier = width / 2 - 10;

let canvas = createCanvas(windowWidth, windowHeight);
canvas.parent("canvas");
}

Expand Down

0 comments on commit 3f5c218

Please sign in to comment.