|
EXERCISES FOR WEEK
4
|
| week4-1 |
Write a function which accomplishes the task you just completed in the last exercise of week 3 (week3-8). That is, write a function
which takes two points as input, A and B, a real value for t, and then returns the point on the line through A and B for that particular value of t. Check your function by passing in points A and B as defined in exercise week3-10 and the values for t. Note: We want to be able to easily use this function for 3D points as well. |
| week4-2 |
In exercise 3-8, we end up plotting 6 points (including the two endpoints) on the line and increment between successive values for t is 0.2. In general, if you want to plot numframes points on the line segment from point A to point B, including the two endpoints, what is the value for increment that you would use?
|
| week4-3 |
Suppose you have an array of points, StartArray, which contains all the vertices of the figure your animation should start with, and a second array of points, DestinationArray, which contains all the vertices of the figure which is the destination of your animation. Assume there are numpoints points in each array. Write a function, FillTween, which takes as input:
and returns an array of points with numpoints points in
it; each point calculated using corresponding points of StartArray and DestinationArray and calling
the function Tween. |
| week4-4 |
Now write a function, DrawSequence, which takes as input:
and does the following:
|