006 - 2.0lab Assignment - Simulating A Ball Throw Using Processing
006 - 2.0lab Assignment - Simulating A Ball Throw Using Processing
Help iimsheung
Digital Design
Course / Topic 5 P Color Theory / Lab Assignment P Processing and Unity Key Framing
Previous Next
Go through the various Processing demos. Once you are familiar with the demos then attempt this assignment. You
will need to use projectile motion equations for this assignment. The equations are in the Appendix.
What you need to do is simulate a projectile motion of a ball thrown for a pre-determined velocity from a pre-
determined direction. These will be parameters you will assign at the start. The output should be the location of the
ball drawn as a circle from start to finish and the related time elapsed at each of those points as shown in Figure 1.
You will be given a bonus if you do the extra step of bouncing after hitting the floor. Save your image as a .jpg file and
submit so that it can be peer reviewed and graded,
NOTEI The acceleration due to gravity J 9.81 m/s2. However, coordinates on a screen are in pixels. So use a
conversion factor of, for example 200 pixels/m. Then convert all meter values to pixels with this conversion.
At start of the program let time t0 = millis(). Thereafter time t = millis()-t0. In the draw loop determine t, and then
calculate (x,y) and draw a circle at that point and write the corresponding time value, t as shown in Figure 1.
Figure 1. Sample output. Your plot should show from start of throw to the point at which the ball hits the floor. The
above figure shows only part of the projectile.
视频 字幕
下载视频⽂件 下载 SubRip (.srt) file
下载 Text (.txt) file
Previous Next