Question: Using processing program Java. This is a tedious exercise, but will really give you a lot of practice with the coordinate system and using variables.
Using processing program Java. This is a tedious exercise, but will really give you a lot of practice with the coordinate system and using variables. You will make a program to generate the crosshairs on the right, based on three initial variables: spacing, crossX, and crossY. The x and y is the center of the cross hairs, and the spacing defines how large it is. a. Create the top center triangle first. Create 6 variables, two per point. For example, t1LeftX and t1LeftY to represent triangle 1s left point X and Y position. i. For the x coordinates, the center triangle point is at the crossX. The left and right are offset by crossX plus or minus the spacing. ii. For the y coordinates, the center triangle point is offset from crossY by the spacing. The top two points are offset by 2*spacing. Hint: the y coordinates of the top two points are the same, so once one is calculated, copy that result into the other variable. b. Then, create the bottom triangle in a similar fashion. Notice that the x coordinates of the bottom triangle are the same as the top. Do not recalculate them, but instead copy them from the first triangle. c. Do similar operations for the left and right triangles. d. Try changing the size and position of your crosshair to make sure your variables and calculations are working properly!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
