xxxxxxxxxx
102
let buffer;
let buffer2
let three;
let bg;
let caveyoff = 0.0;
let mic, fft;
let sw;
let sh;
//for flowfield
let numnoise = 1200;
var particles_a = [];
var particles_b = [];
var particles_c = [];
let noiseScale = 500;
let noiseStrength = 4;
//for Electric Sphere
var pathPoints = []
//For Gradient Landscape
var inc1 = 0.0019;
var start = 0;
var xAxis = 2;
var yAxis = 1;
var m1,m2,b1,b2; //Mtns and BG
//For Steering Wheel
var shadow;
var theata = 0;
//for epic star
var colorCount = 20;
var hueValues = [];
var saturationValues = [];
var brightnessValues = [];
var actRandomSeed = 0;
var alphaValue = 75;
function setup() {
createCanvas(windowWidth,windowHeight, WEBGL);
smooth();
initOverlay1to3();
initoverlay4();
initOverlay5();
initOverlay6();
initOverlay7();
initOverlay7();
three = createGraphics(width,height,WEBGL);
three.noStroke();
noCursor();
sw = width/64;
mic = new p5.AudioIn();
mic.start();
fft = new p5.FFT(0.7,2048);
fft.setInput(mic);
fft1 = new p5.FFT(0.6, 64);
fft1.setInput(mic);
fft2 = new p5.FFT(0.6,2048);
fft2.setInput(mic);
}
function draw() {
background(220);
drawOverlay8();
texture(buffer);
plane(width,height);
let locX = mouseX - height / 2;
let locY = mouseY - width / 2;
three.resetMatrix();
three._renderer._update();
three.background(255,0);
three.ambientMaterial(250);
three.ambientLight(60, 120, 60);
three.pointLight(255, 255, 255, locX, locY, sin(frameCount*0.1) * 1000);
let xx = sin(frameCount*0.01) * width/2 + map(mouseX,0,width,-width,width);
let yy = cos(frameCount*0.01) * height/2 + map(mouseY,0,height,-height,height);
three.push();
three.push();
three.translate(xx, 0, yy);
drawScene1();
three.pop();
three.push()
three.pointLight(0, 0, 255, locX, locY, 100);
three.translate(xx, yy, -1000 + sin(frameCount*0.001)*400);
//drawScene2();
three.pop();
three.pop();
texture(three);
plane(width,height);
}