Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Rouge Pixel For Semi-Circle Wave "Detect?"... ;^)
- First try by: Chris M. Thomasson
- ____________________________________________________*/
- float t = 0;
- float tinc = .4;
- float mr = 128;
- void setup()
- {
- size(800, 800);//canvas
- t=0;
- noFill();
- background(0);
- colorMode(RGB, 255);
- }
- void draw()
- {
- translate(width/2, height/2);
- // sin cos pair.
- float tcos = (cos(t)+floor(sin(t))*2+1);
- float tsin = sin(t);
- // projection
- float x = tcos * mr;
- float y = -tsin * mr;
- // color
- float a = floor(t * 1234) % 256;
- float b = floor(t * 4520) % 256;
- stroke(a, 255, b);//white
- line(x, y, 0, 0);
- // detect rouge pixel... Simple! ;^)
- if (tcos > 2)
- {
- println("ROUGE PIXEL AT: (", tcos, ", ", tsin, ")");
- println("noLoop()");
- noLoop(); //term
- }
- // bump t, at the end
- t += tinc;
- }
Advertisement
Add Comment
Please, Sign In to add comment