--[[ ---------------------------------------------------------- Mosaic | OF Visual Patching Developer Platform Copyright (c) 2018 Emanuele Mazza aka n3m3da See https://github.com/d3cod3/Mosaic for documentation ---------------------------------------------------------- Noise Repetición, Created by Francisco Javier Guillem ]] mouseX = 0 mouseY = 0 inc = 20 -- Variables retícula vel = 0.5 v=0.0 -- Variables Nosie cni=0.01 ---------------------------------------------------- function setup() of.enableSmoothing() of.setCircleResolution(40) end ---------------------------------------------------- function update() v = v + cni -- Variación noise inc = inc + vel -- Incremento retícula if inc > 40 or inc < 20 then vel = vel * -1 -- Cambio dirección (zoom) end end ---------------------------------------------------- function draw() of.setColor(0, 0, 0, 50) -- fondo negro transparente of.drawRectangle(0, 0, OUTPUT_WIDTH, OUTPUT_HEIGHT) of.noFill() of.setColor(0,155,50) for i=0, OUTPUT_WIDTH, inc do for j=0, OUTPUT_HEIGHT, inc do of.drawRectangle(i,j,inc/2-1,inc/2-1) -- retícula end end of.fill() of.setColor(0,255,0) x = of.map(of.noise(v),0.15,0.85,0,OUTPUT_WIDTH,false) y = (OUTPUT_HEIGHT/2) + of.random(-10,10) of.drawEllipse(x,y,76,46) -- Movimiento elipse por noise end ---------------------------------------------------- function exit() end -- input callbacks ----------------------------------------------------