Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It's a Processing 3 Java problem Basic setup a. window size: (500, 200) b. frameRate: 10 c. background: black Generate random numbers for the red,

It's a Processing 3 Java problem

Basic setup

a.

window size: (500, 200)

b.

frameRate: 10

c.

background: black

Generate random numbers for the red, green, blue factor of the fill color of each circle (i.e., 3

float values for each circle). The range for the random numbers is 0 ~ 255.

Draw the following three circles with the fill colors generated.

a.

Circle 1 (center: (100, 100), W: 100, H: 100)

b.

Circle 2 (center: (250, 100), W: 100, H: 100)

c.

Circle 3 (center: (400, 100), W: 100, H: 100)

Compute the intensity of the fill color of each circle. The intensity of a color is the arithmetic

mean of the R, G, and B value of the color. We will use an integer value (0 - 255) for the

intensity. So, you will need to cast the arithmetic mean (float data type) to an integer.

Keep the circle with the maximum intensity on screen and make the other circles slowly faded out

over time. You will use the fade-out trick that draws a rectangle that covers the entire canvas with

low transparency value in the draw function. Note that it is possible to keep two or three circles

when their intensity values are identical.

Here are the steps of my assignment, and the following is my code

//determine the size size(500,200); //determine the frame rate frameRate(10); //determine the background color background(0,0,0);

//generate the 3 different colors for each circle color c1 =color (random(255),random(255),random(255)); color c2 =color (random(255),random(255),random(255)); color c3 =color (random(255),random(255),random(255)); fill(c1);

ellipse(100,100,100,100);

fill(c2); ellipse(250,100,100,100);

fill(c3); ellipse(400,100,100,100);

I really don't know what I can do for computing the intensity of the color of each circle, also I would like to know how I can may the color being faded over time. Thanks!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

politeness and modesty, as well as indirectness;

Answered: 1 week ago