This assignment makes use of the files contained in this zip file. This assignment is due Friday, December 10.
This assignment uses model transformations on P, N, and W letter models to create an animation. This assignment is based on renderer_7.zip and specifically on the sub-folder "basic transformation examples
".
In the zip file there is an animation file, animation.gif
and an outline of a Java program OfflinePNW.java
. You should complete the Java program so that it replicates the animation. For the P, N, and W letters, use the models contained in the zip file (that will make it easier to duplicate the animation).
For this assignment, you should do all the transformations of a model using the model-to-view matrix in the Position
object that holds the Model
object.
In the renderer_7.zip zip file there is a sub folder "basic transformation examples
" containing several examples of using translations and rotations to create animations. Build the Javadoc for that folder and open the html
sub-folder's index.html
file using a web browser. The Javadocs combine each example's explanation with it animated gif file.
Also look at RotationExample_v1.java
and its variations in renderer_7.zip.
Here is the most important thing to remember from those examples. If you want to rotate a model around the point (a,b,c)
in the model's coordinate system, and you want this rotation to happen at the point (u,v,w)
in the camera's view coordinate system, then you would do that with the following three transformations (where position
is the Position
object holding the Model
object).
position.matrix = Matrix.translate(u, v, w); position.matrix.mult(Matrix.rotate(theta, _,_,_)); // choose any axis position.matrix.mult(Matrix.translate(-a, -b, -c));
You can abbreviate this a bit by chaining the multiplications.
position.matrix = Matrix.translate(u, v, w) .mult(Matrix.rotate(theta, _,_,_)) // choose any axis .mult(Matrix.translate(-a, -b, -c));
Notice, for example, that the letter W
rotates around the middle of its top edge, and this point is anchored at the point (x, y) = (1.5, 1.0)
in camera coordinates (the red tick-marks on the x and y axes are 1/2 a unit apart).
Notice also that the letter P
rotates around the point (x, y) = (2, 0)
in its model coordinates and the rotation happens at the origin in the camera coordinate system.
In the zip file there is a folder, animation_frames
, that contains all the frames from animation.gif
. These individual frames make it a bit easier for you to figure out exactly what is happening in the animation.
In the zip file there is a program InteractiveLetterTester.java
that lets you examine more carefully the models for P
, N
, and W
. Edit line 37 of that file to choose which letter model you want it to load. Use "drag-and-drop" on the script file build_&_run_client.cmd
to run InteractiveLetterTester.java
(and also your version of OfflinePNW.java
).
After you have OfflinePNW.java
working, convert the 360 image frames that your program produces into your own "animation" file. To do this you need to download the following zip file and unzip it to your C:\
directory.
After you have ImageMagick on your computer, and after you run your version of OfflinePNW.java
to produce all the animation frames, just double click on the command file ImageMagick-7.1.0-portable-Q8-x64s.cmd
and it should (I hope) use your frames to create an animation file called animation.gif
. Double click on your animation file to see your movie.
The ImageMagick project updates its software fairly often and when they do, the last version disappears from their web site and is replaced by the most recent version. So the download link given just above will become broken soon. If its broken, go to their web site and look for the most recent version.
Turn in a zip file called CS455Hw5Surname.zip
(where Surname
is your last name) containing your version of OfflinePNW.java
and your version of animation.gif. (Please DO NOT send me your 360 image frames.)
This assignment is due Friday, December 10.