Question

processing pde design two different works of recursive shapes, must incorporate pushMatrix() , popMatrix(), and ArrayList...

processing pde

design two different works of recursive shapes, must incorporate pushMatrix() , popMatrix(), and ArrayList along with both mouse and key interactivities

Homework Answers

Answer #1
int c_center = 25;
int c_petal = 30;
int petalsize = 80;
color col;

void setup(){
  fullScreen();
  background(0);
}

void draw(){
  rcol = color(random(255), random(255), random(255));
}

void mouseClicked(){
  pushMatrix();
  flower();
  translate(mouseX, mouseY);
  rotate(PI/4);
  flower();
  popMatrix();
}

void flower(){
  //left petal
  make_petal(mouseX - (petalsize - c_petal), mouseY, petalsize, c_petal);
  //right petal
  make_petal(mouseX + (petalsize - c_petal), mouseY, petalsize, c_petal);
  //top petal
  make_petal(mouseX, mouseY - (petalsize - c_petal), c_petal, petalsize);
  //bottom petal
  make_petal(mouseX, mouseY + (petalsize - c_petal), c_petal, petalsize);
  //flower center
  fill(random(255), random(255), random(255));
  ellipse(mouseX, mouseY, c_center, c_center);
}

void make_petal(int w, int x, int y, int z){
  fill(col);
  ellipse(w, x, y, z);
}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
If an employee works in several different states during the year, the employer must determine which...
If an employee works in several different states during the year, the employer must determine which state covers the worker for unemployment compensation purposes. How is this determination made? Additionally, can an employee working in two or more states be categorized as being localized only in one state? Explain Have you ever worked in two different states prior to filing for unemployment? What were your experiences? Explain.
The manager of a canned food processing plant must decide between two different labeling machines. Machine...
The manager of a canned food processing plant must decide between two different labeling machines. Machine A will have a first cost of $42,000, an annual operating cost of $28,000, and a service life of 4 years. Machine B will cost $51,000 to buy and will have an annual operating cost of $17,000 during its 4-year life. At an interest rate of 10% per year, which should be selected on the basis of a annual worth analysis?
Python recursive design question: Background: The class vote creates vote objects. A vote is either a...
Python recursive design question: Background: The class vote creates vote objects. A vote is either a blue vote, a red vote, or a purple. This information is stored in the "value" attribute. The function Poll returns a list of random votes. In the code below, some_poll is a list of 32 random votes. some_poll = Poll(32) # ----------------------------------------------------- import random # ----------------------------------------------------- # # Return a list of n random votes # # ----------------------------------------------------- def Poll(n=16): # # A random...
A computer scientist is investigating the usefulness of two different design languages in improving programming tasks....
A computer scientist is investigating the usefulness of two different design languages in improving programming tasks. Twelve expert programmers, familiar with both languages, are asked to code a standard function in both languages, and the time (in minutes) is recorded. The data follow: Programmer Time Design Language 1 Design Language 2 1 17 18 2 17 14 3 21 20 4 14 11 5 18 23 6 24 21 7 15 10 8 14 13 9 21 19 10 23...
Part I: Two different firms design their own version of the same aptitude test, and a...
Part I: Two different firms design their own version of the same aptitude test, and a psychologist administers both versions to the same randomly selected subjects with the results given below. At the .05 significance, test the clam that both versions produce the same mean. Assume both populations are normal. Test A(before) 109 118 104 127 126 99 104 108 113 Test B (After) 102 115 107 116 104 91 113 112 112 Claim: Null Hypothesis: Alternative Hypothesis: Calculator Screen...
MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment:...
MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment: MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment: In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted using two different encryption algorithms. Detailed specifications: Define an...
Stock Inc. has two sites in Pittsburgh that are four miles apart. Each site consists of...
Stock Inc. has two sites in Pittsburgh that are four miles apart. Each site consists of a large factory with office space for 25 users at the front of the factory and up to 50 workstations in two work cells on each factory floor. All office users need access to an inventory database that runs on a server at the Allegheny Street location; they also need access to a billing application with data residing on a server at the Monongahela...
Introduction Purpose Your goal is to create a design for a software interface. You will experience...
Introduction Purpose Your goal is to create a design for a software interface. You will experience the scope of the design process from brainstorming ideas and gathering information about users’ needs to storyboarding, prototyping, and finally, testing and refining your product. As you work on the software interface, you will demonstrate your ability to apply fundamental Human-Computer Interaction principles to interface analysis, design, and implementation. You will be responsible for delivering project components to your professor at several points during...
SECTION A: CASE TWO READ THE CASE CAREFULLY AND ANSWER THE QUESTIONS THAT FOLLOW DIGITAL SERVICE...
SECTION A: CASE TWO READ THE CASE CAREFULLY AND ANSWER THE QUESTIONS THAT FOLLOW DIGITAL SERVICE FOR STUDENTS IN HIGHER EDUCATION (DSSHED) Digital Service for Students in Higher Education (DSSHED) is an innovation platform for the creators of next generation products and services. It was founded by the Ingenious Investment Group (IIG). The objective of DSSHED is to boost multidisciplinary agile innovation culture and encourage entrepreneurship in its catchment region. DSSHED provides students and companies with a collaborative and multidisciplinary...
In 100 words state if you agree or disagree with the summary given for the Scenario....
In 100 words state if you agree or disagree with the summary given for the Scenario. PLEASE reframe from using Overuse of ambiguous terms such as it, this, and they should not be used. Scenario Part 1: Workplace unrest Environment: You are the Director of a team of employees that do various PA duties. The team consists of 15 employees that are assigned duties in different building locations and collocated with other PA personnel from other directorates in a matrix...