SHARE
TWEET

Untitled

a guest Feb 24th, 2018 199 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup(){
  2.   size(400,900);
  3.   background(255);
  4. }
  5. float angle=0;
  6. void drawDNA(float a,float b,float y){
  7.   stroke(0);
  8.   fill(0);
  9.   rect(a,y-3,b-a,5);
  10.   stroke(67, 133, 239);
  11.   fill(67, 133, 239);
  12.   ellipse(a,y,20,20);
  13.   stroke(#fc2f2f);
  14.   fill(#fc2f2f);
  15.   ellipse(b,y,20,20);
  16. }
  17. int fromScreen=190;
  18. int multiFact=70;
  19. float anglePlus = 0.04;
  20. int iDiv = 5;
  21. int distanceFromBars = 17;
  22. void draw() {
  23.   background(255);
  24.   for(float i=0;i<80;i++)
  25.   drawDNA(fromScreen+sin(angle+i/iDiv)*multiFact,fromScreen+0-sin(angle+i/iDiv)*multiFact,distanceFromBars*i);
  26.   angle+=anglePlus;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top