Thomas de Rijk
YaBB Newbies
Offline
Posts: 8
Rotterdam
Re: Random lines from one circle to another
Reply #11 - Oct 13th , 2009, 10:58am
oke hi im back again, i looked into the storin and stuff, but i'm getting hugely confused SOOO could someone help me out or even write a quick program wich draws a line from coordinate a to b with a speed control? (line should grow over time) that would be totally awesome here's what i have so far, and i know i should make the line into an object, still have to do that, been trying to do this in max msp and quartz composer as well import peasy.*; PeasyCam cam; float beginX = random(-400, 400); float beginY = random(-300, 300); float beginZ = -5000; float endX = random(-400, 400); float endY = random(-300, 300); float endZ = 5000; float distX = 0.0; float distY = 0.0; float distZ = 0.0; float z = 0.0; float step = 0.02; float pct = 0.0; void setup() { size(768, 576, P3D); cam = new PeasyCam(this, 100); smooth(); distZ = endZ - beginZ; frameRate(120); } void draw() { background(0); pct += step; if (pct < 1.0) { z = beginZ + (pct * distZ); } stroke(random(255), random(255), random(255), 100); strokeWeight(2); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); line(random(-800, 800), random(-800, 800), -8000, random(0), random(0), 8000); }