1 / 13

midterm Exam review

midterm Exam review. TECH 3601. Statistics. Average: 75.45 Highest: 95 >90: 4 >80: 6 >70: 6 >60: 3 <60: 3. RGB Color & Transparency. Each color has a value between 0 and 255 colorMode (RGB,100 ); colorMode (RGB,255,100,100) Transparency // 50% opacity fill(255,0,0,127 );

flo
Download Presentation

midterm Exam review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. midterm Exam review TECH 3601

  2. Statistics • Average: 75.45 • Highest: 95 • >90: 4 • >80: 6 • >70: 6 • >60: 3 • <60: 3

  3. RGB Color & Transparency • Each color has a value between 0 and 255 • colorMode(RGB,100); • colorMode(RGB,255,100,100) • Transparency • // 50% opacity • fill(255,0,0,127); • // 25% opacity • fill(255,0,0,63); • rect(0,150,200,40);

  4. Q2-Q4 • size(screen.width, screen.height); • line(pmouseX, pmouseY, mouseX, mouseY); • if (mouseX>x1 && mouseY>y1 && mouseX<x2 && mouseY<y2)

  5. Q5(1) • line(width/2, height/2, width/2, 0); • line(width/2, height/2, 0, height); • line(width/2, height/2, width, height);

  6. Q5(2) • fill(0); • rect(0, 0, width/2, height/2); • fill(150); • rect(width/2, height/2, width/2, height/2);

  7. Q6(1) • int y = 25; • int speed = 1; • void setup() { • size(200,200); • } • void draw() { • background(255); • fill(175); • ellipse(width/2, y, 50, 50); • y = y + speed; • }

  8. Q6(2) (3) • if (y > height – 25) { • y = height – 25; • } • y = constrain(y, 25, height-25);

  9. Q6(4) • if (y > height – 25 || y < 25) { • speed = speed * -1; • }

  10. Q7(1) • void setup() { • size(200,200); • } • void draw() { • background(255); • fill(175); • ellipse(mouseX, mouseY, 50, 50); • }

  11. Q7(3) • void setup() { • size(200,200); • background(255); • } • void draw() { • if (mousePressed) { • fill(0); • } • else{ • fill(255); • } • ellipse(mouseX, mouseY, 50, 50); • }

  12. Q7(4) • void setup() { • size(200,200); • background(255); • } • void draw() { • } • void mousePressed() { • fill(175); • ellipse(mouseX, mouseY, 50, 50); • }

  13. Q8 • void setup() { • size(200,200); • } • void draw() { • for (inti = 0; i < width; i++) { • stroke(255-i); • line(i, 0, i, height); • } • }

More Related