Math Linear Algebra for Application; The MATLAB Animation Project

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Follow the instructions step by step to complete it. This is an overall assignment, but you need to complete the first one before completing the other part. We can negotiate at any time regarding the completion time of the assignment. Don’t forget one important thing, “notes” in the code. Please comment as much as possible on the steps you think are critical or where there may be doubts for new students.

Math 645
Animation Assignment 1
Due March 25, 2020
This project will be worth 150 points and this is just the beginning part. Bonus points may be awarded.
GOAL: Create a computer animation using Matlab. You will be given template programs (and you should probably
use them) such as the programs moveN.m, morphME.m, Jpeg2PointsConverter2.m, moveOtto.m as a starting point,
and then adapt the programs to create your animation. However, we will first start with something simple:
(A) The first thing you should do is create a character. You can do this by using a computer
tool to sketch the character or their outline. Or, you can download a character of your choice from
the Web. Save the character as a .jpeg file to keep things simple. You might also want to figure
out how to fill the character to create the desired coloration, etc.
As an example for you, I have placed the file CharlieBrown.jpg in the Matlab Files module on
Canvas. If you read in the picture using the command:
>> CB=imread(’CharlieBrown.jpg’);
(you might have to switch to the directory with the .jpg file to make it work), the net result is that
matrix CB will hold the RGB values for the Charlie Brown picture (it is actually a 3-D array, but
don’t worry about that for now). Next, run the CB matrix through the Jpeg2pointsConverter2
script using the command:
>> CBout = Jpeg2pointsConverter2(CB,220);
Note that 220 is the THRESHOLD value used by the Jpeg2pointsCoverter2 script. When you
choose your own character, you will have to see if the image looks OK and the number of total
points in the output matrix (CBout here) is only a few thousand. If you don’t like the resulting
image or it has too many points, try again with a different THRESHOLD value (higher THRESHOLD values give fewer points). You should read the help info at the top of Jpeg2pointsConverter
to see more details.
(B) For this first stage of your animation you should take your character and transform
it by each of these required matrix transform elements: (a) rotations, (b) shifts, (c) shears,
reflections, or rescalings, (d) transformations or alterations of your character such as a morph.
Show a before and after plot for each case, and record the transformation matrices (or morphing
rules if you use them).
(C) Make your character walk off the screen along some vector path. You can do this in
several ways, but in your write-up, be sure to explain the methods you used (for example, you can
use the homogeneous coordinates approach that was used in the moveN.m script; or, you can use
the matrix outer product approach that will be described in class).
This next part is more complicated, since it involves having your character away from the origin,
sitting somewhere in the “scene.” Then, since most of our transformations are defined around
the origin, you must (mathematically) transport your character to reference coordinates about the
origin, where you will transform it before placing it back in the scene. For your write-up of this
part, you should include your matlab code and explain the transformations that you used.
(D) For this more advanced part of your animation, I want you to write a matlab function/script that can take in a character located anywhere in a scene, transform it to reference
coordinates where you can perform transformations, then do the transformations and put the character back in the scene. You should take your character and transform it multiple times within
a for loop by at least two of these matrix transform elements : (a) rotations, (b) shears,
reflections, or rescalings, (c) other transformations/alterations or morphs of your character. Show
some plots to capture the action and include them in your write-up.
(E) We will try to find a time in class where you can demonstrate your animation (and this
will help me to assign bonus points).
Math 645
Animation Assignment Final
Due Dec. 9, 2019
Animation Completion: Use Matlab extensively and any tricks you have learned.
The final part is worth 150 points. Particularly good projects will earn bonus points.
GOAL: Create a computer animation using Matlab, and put together your creativity with all of the linear algebra and
Matlab functions you have learned over the semester. Be creative and design an animation that tells a story of some sort
(for simplicity, you can describe the setting and background in words if you can’t get a real background to work). You
can make use of the template programs provided throughout the semester such as the programs moveN.m, morphME.m,
Jpeg2PointsConverter2.m, moveOtto.m movePPandPassOnPPout.m, and PlotBackground.m but I would really like you
to adapt the programs (alter them greatly or write your own code) to create your animation.
For this part of the project, I would like you to form groups of four (or at most five) people. As a group, you should
decide what story line you want to pursue. You can choose new characters, or a combination of the characters you have
used so far. Please report to me your group if you haven’t already done so, and choose a name for your group (seriously!).
(A) Step one will be to decide on a story line. The story line should be subdividable into groups of four or five stages of
motions or actions, and each member of the group should take responsibility for one of the stages. I would like you to
produce an outline of the planned storyline as a template matlab script where you use “empty” for loops to define each
section and the expected inputs and outputs (as described in class). Please submit this outline by Nov. 25th.
(B) In the last part of the first animation assignment, you experimented with taking a character matrix, shifting it to
reference coordinates at the origin so that the character could be transformed, then doing a further shift/transform to put
the character into the scene. In this part of the animation project, I want you to do the shifting and scene placement in
a matlab function. To make this more straightforward, I have written an example function for you and in the description
below, CCout is just the CharlieBrown image used earlier in the course – here is the scenario:
Imagine you are part of an animation team, and you will be responsible for one set of movements of the character (e.g., fly
around like Tinkerbell and land on a flower). To work as part of a team, you must accept the character from a different
piece of code developed by a co-worker. Therefore, you must accept the current character matrix of points, and also the
coordinates of the center of the character, x0 and y0 (and you can use these to pull the character back to the origin so
you can do further transformations, etc.). When you are finished with your transformations, you must pass along the
information about the current character matrix and also its final position. You should also return a flag indicating that
your code actually ran through properly (we will call this out flag). Consequently, the function call must look like the
following:
[out flag, PPout, x final, y final] = movePPandPassOnPPout(CCout, x0, y0);
To make things easier for you, I have written an example function/script called movePPandPassOnPPout.m which I will
place in the course Canvas Modules. If you read through the program, you will see that I have labeled lines (1), (2), (3),
…, (10) in the function. If you remove the comment symbol (%) and the number with parentheses from the beginning of
the line, the code should run and give you an example of the desired output. You should write your own code or adapt
this code to satisfy this part of the animation assignment.
(C) Next, since the movePPandPassOnPPout function outputs the new character matrix (PPout) and its position, you
should realize by now that this allows you to chain together unlimited numbers of transformation stages, since the output
of one stage can be fed directly into the next stage of transformations. Hence, your story should take your character(s)
and have them pass through a series of actions that tell some sort of story; you are each responsible for three sets of
movements of the character (for example, fly around like Tinkerbell, go into a tailspin and get dizzy, and then land on a
flower). Also I want you to use for loops and not just copy and paste a set of steps. As I mentioned, each team member
has to design a stage and you should assume each stage will have three separate motion or transformation elements that
contribute to the story line. Generally I would expect to see these sorts of matrix transform elements :
(a) rotations, (b) shifts, (c) shears, reflections, or rescalings, (d) transformations or alterations or morphs of your character,
(e) affine transformations to shift your character through a scene.
(D) If you want to put a background in your animation, you can refer to the function called PlotBackground.m (this is
one that I will show in class with Wile E. Coyote and Road Runner), along with the images I used.
When the assignment is turned in, I want a sequence of images like a film strip, with 12-16 images on a page (one upload
per team). You should include a sequence of images for each team member’s contribution (labeled with the student name)
and then include a printout of the section of matlab code that creates the images. You should include text to give the
story line. I also want you to create a zip file with the all of the team’s matlab software and input files so I can look at
them – please post the zip files to the upload link. You must add comments in the Matlab code to indicate each team
member’s code contribution. Your grade will primarily depend on your own contribution, but bonus points are generally
awarded for the overall team animation.
We will dedicate part of the last class to demonstrations of your animations (and this will help me to assign bonus points).
See if you can come up with something that really shows off what you have learned, and please remind me to have you
record them on your cell phones, or save them as movie files. Good luck!

Are you stuck with your online class?
Get help from our team of writers!

Order your essay today and save 20% with the discount code RAPID