Write a program to produce a "movie". The movie consists of a sequence of movements of an object. You are to create the movements by creating and applying a sequence of transformation matrixes. Each matrix is to take the object from the old location to the new location. This requires you get the old matrix and update it with the new parts to show the next image in the movie. That is, you are to do the transformation calculations your self. You are to make two runs of these calculations. The first time move the object (only one copy of the object on the screen at a time). The second time add copies of the object to the image. This second form is to be printed for hand-in.
The program Cone2.cxx is one example of showing multiple images in a "movie". The program MotBlur.cc shows a way to display the full movie in one picture. You could instead, create a separate agent for each "image" in the movie. MotBlur.cxx uses the SetSubFrames command with the number of subframes. If you set it to 5, you will then need 5 calls to Render to fill the 5 SubFrames. You need to be able to create and update a 4x4 matrix for the vtk transformations. The following methods are available in vtkActor:
vtkMatrix4x4& GetMatrix() void GetMatrix(vtkMatrix4x4& result) void SetUserMatrix(vtkMatrix4x4*) void SetUserMatrix(vtkMatrix4x4&) vtkMatrix4x4 *GetUserMatrix()There are some other methods vtkActor has that can be of use:
void GetPosition(float data[3]) void SetPosition(float,float,float) void SetOrientation(float x, float y, float z) float *GetOrientation()
If you look at pp74-79 [Schroeder, Martin, Lorensen 98] you will see how to use the built in matrix manipulation commands.