AB.removeRunHeader();
const MUSICFILE = '/uploads/cdugga/stillcornersblacklagoon-Cool.DJ.mp3';
AB.backgroundMusic ( MUSICFILE );
let r, g, b, brightness, size, f;
function setup() {
createCanvas ( ABWorld.fullwidth(), ABWorld.fullheight(), WEBGL );
r = createSlider(0, 255, 127);
r.position(20, 620);
g= createSlider(0, 255, 127);
g.position(20, 640);
b= createSlider(0, 255, 127);
b.position(20, 660);
brightness= createSlider(0, 500, 255);
brightness.position(20, 680);
size= createSlider(1, 50, 1);
size.position(20, 700);
f= createSlider(0, 1, 0.1, 0.02);
f.position(20, 720);
s= createSlider(1, 50, 25);
s.position(20, 740);
d= createSlider(0, 500, 100);
d.position(20, 760);
rDisplay = createP()
rDisplay.position(170, 604)
gDisplay = createP()
gDisplay.position(170, 624)
bDisplay = createP()
bDisplay.position(170, 644)
brightnessDisplay = createP()
brightnessDisplay.position(170, 664)
sizeDisplay = createP()
sizeDisplay.position(170, 684)
fDisplay = createP()
fDisplay.position(170, 704)
sDisplay = createP()
sDisplay.position(170, 724)
dDisplay = createP()
dDisplay.position(170, 744)
}
function draw() {
background(0);
orbitControl();
(rDisplay.html('Red '+r.value())).style('color', 'white');
(gDisplay.html('Green '+g.value())).style('color', 'white');
(bDisplay.html('Blue '+b.value())).style('color', 'white');
(brightnessDisplay.html('Brightness '+brightness.value())).style('color', 'white');
(sizeDisplay.html('Sphere size '+size.value())).style('color', 'white');
(fDisplay.html('Length '+f.value())).style('color', 'white');
(sDisplay.html('Amount '+s.value())).style('color', 'white');
(dDisplay.html('Width '+d.value())).style('color', 'white');
const values = [r, g, b, brightness, size]
let locX = mouseX - height / 2;
let locY = mouseY - width / 2;
pointLight(values[0].value(), values[1].value(), values[2].value(), locX, locY, values[3].value());
rotateY(frameCount * 0.01);
for (let j = 0; j < 50; j++) {
push();
for (let i = 0; i < s.value(); i++) {
translate(
cos(frameCount * 0.001 + j) * d.value(),
cos(frameCount * 0.001 + j) * 1,
i * f.value()
);
rotateZ(frameCount * 0.002);
push();
noStroke()
specularMaterial(250, 0, 0);
sphere(values[4].value());
pop();
}
pop();
}
}