CST112 Project 2 (Chapter 3)
-
Design some object of your own (this should be a different object
than the one you created for Project 1) that can be manipulated by
moving it around the Processing output window as follows:
- The size of the output window should be minimally 250 by 250 pixels
-
Draw an object (something completely different than what you
created for Project 1 and which is complex enough to use many
of the functions that we learned in the first two chapters).
The object should move with the "center" of the image
following the mouse pointer (you should determine an arbitrary
location that is the center of your object); use the
mouseX
and mouseY
system variables and the appropriate arithmetic
calculations from the center of the object to implement this
functionality
(
You will receive a maximum of 8 points out of 10
if you complete this much of the assignment successfully
)
-
For "additional points" do either or both of the following:
-
For one (1) additional point of credit,
control the fill color for the object using the mouse's
x-coordinate and y-coordinate values; add more red or green
or blue to the fill color of the major parts of your object
as the mouse moves from left to right and from top to bottom;
the object should be at its full natural color when it reaches
the bottom-right corner of the screen
-
For one (1) additional point of credit,
the background color should change from white to black
based upon the position of the mouse in the output window;
if the mouse is exactly at the upper-left corner the
background color is white; if the mouse is exactly at
the lower-right corner the background is black; at any
other location in the output window the background will
be some shade of greyscale which gets darker the closer
it comes to the lower-right corner; to accomplish this
requires an arithmetic statement that starts with the
sum of the mouseX and mouseY system variables
and continues by factoring it so the result of the calculation
is exactly 255 when the mouse is in the
upper-left corner and exactly zero (0) when it
is in the lower-right corner
-
Full credit (10 points out of a maximum of ten) will
be given for successfully completing all parts of this assignment
-
Click this Play Project 2
link to view a sample application that shows all the different effects
(this is the full credit version with a "Smiley Face")
-
Insert the project number, your name and the name(s) of your
teammate(s), your e-mail address, the submission due date and
one or two sentences that describe the sketch as comments
at the beginning of the program (the same as you did for Project 1);
additionally comment each of the sections of code
-
Students may work on all projects in teams of two or three,
and, if so, all students in the group must submit the same project to their own dropboxes
in Blackboard. In the text box's dropbox, as well as in the source code documentation
(comments), state the name(s) of the classmate(s) with whom you worked.
-
The completed project archived into a ".ZIP" file submitted
electronically via an attachment to a
Brightspace
dropbox is due to Prof. Struck no later than 11:59 p.m. on the date
listed in the course outline.