Advertisement
ramomjcs

Q3 - PG

Mar 17th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. int cx = 250;
  2. int cy = 250;
  3. int r = 100; //raio da circunferência maior, movimento da bolinha
  4. float r1 = r - 25;
  5.  
  6. void setup() {
  7. size(500, 500);
  8. //textFont(createFont("Arial", 30));
  9.  
  10. }
  11.  
  12. void draw() {
  13. background(150);
  14. stroke(0);
  15.  
  16. float t = -1 * millis()/1000.0f; // -1 é anti-horário
  17. int x = (int)(cx+r1cos(t)); // int x = (int)(cx+rcos(t));
  18. int y = (int)(cy+r1sin(t));
  19.  
  20. //circulo externo
  21. circle(1252, 125*2, 200);
  22. noFill();
  23.  
  24. //circulo interno
  25. point(x,y);
  26. ellipseMode(CENTER); // Set ellipseMode is CORNER
  27. fill(255); // Set fill to white
  28. ellipse(x, y, 50, 50); // Draw white ellipse using CORNER mode
  29.  
  30. //ponto do circulo de dentro
  31. ellipseMode(CENTER); // Set ellipseMode to CORNERS
  32. fill(100); // Set fill to gray
  33. ellipse(x-17, y-17, 10, 10); // Draw gray ellipse using CORNERS mode
  34.  
  35.  
  36.  
  37.  
  38. //ponto
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement