--[[ ---------------------------------------------------------- Mosaic | OF Visual Patching Developer Platform Copyright (c) 2018 Emanuele Mazza aka n3m3da See https://github.com/d3cod3/Mosaic for documentation ---------------------------------------------------------- Traslación - Rotación - Trigonometria, created by mj ]] posx = 1280/2 posy = 720/2 _angle = 0 range = 0 speed = 2.5 mouseX = 0 mouseY = 0 ---------------------------------------------------- function setup() range = of.random(-0.6, 0.6) end ---------------------------------------------------- function update() _angle =_angle + range posx = posx + math.cos(_angle)*speed posy = posy + math.sin(_angle)*speed end ---------------------------------------------------- function draw() of.setColor(255, 255, 255, 1) -- fondo blanco muy transparente of.drawRectangle(0, 0, OUTPUT_WIDTH, OUTPUT_HEIGHT) of.setColor(0, 0, 0, 100) of.translate(posx, posy, 0) -- Traslada el punto (0, 0) al que definen posx y posy of.rotateZDeg(_angle) of.drawLine(0, -180, 0, 180) end ---------------------------------------------------- function exit() end -- input callbacks ----------------------------------------------------