float noiseVal; float noiseScale = 0.005; float noiseCount = 0.0; float noiseSpeed = 0.05; float xCount, xSpeed; float yCount, ySpeed; float theta; float angle; float angleDelta; float xv, yv; float speed = 10; boolean lines = false; boolean blurs = true; int noiseRes = 6; Vehicle[][] vehicle; int xSize = 400; int ySize = 400; int xTotal = int(xSize / noiseRes); int yTotal = int(ySize / noiseRes); void setup(){ size(xSize,ySize); smooth(); ellipseMode(CENTER_DIAMETER); colorMode(HSB, 360); background(0); vehicle = new Vehicle[yTotal][xTotal]; for (int y=0; y width + 50){ x -= width + 100; } if (y < -50){ y += height + 100; } else if (y > height + 50){ y -= height + 100; } } void render(){ stroke((angle - 180)/3, 0,360); line(x,y, x+(xv/1.0), y+(yv/1.0)); } } void blur() { int index,sum,left,right,top,bottom; for(int j=0;j0) left=-1; else left=xSize-1; if(j==(xSize-1)) right=-xSize+1; else right=1; if(i>0) top=-xSize; else top=(ySize-1)*xSize; if(i==(ySize-1)) bottom=-(ySize-1)*xSize; else bottom=xSize; // Calculate the sum of n neighbors sum=pixels[left+index] & 255; // left middle //sum+=pixels[left+top+index] & 255; // left top //sum+=pixels[left+bottom+index] & 255; // left bottom sum+=pixels[right+index] & 255; // right middle //sum+=pixels[right+top+index] & 255; // right top //sum+=pixels[right+bottom+index] & 255; // right bottom sum+=(pixels[index] & 255); // middle middle sum+=pixels[index+top] & 255; // middle top sum+=pixels[index+bottom] & 255; // middle bottom sum=(sum/6); pixels[index]=(sum<<16)+(sum<<8)+sum; } } }