r4 - 29 Jun 2006 - 19:20:03 - TimPetersonYou are here: TWiki >  GRAPEcluster Web  >  Documentation > CreatingASimpleMovie

Creating a Simple Movie

Goals:

  • Load and modify an example .movie file
  • Create a simple circular path around the system
  • Save our edited .movie file out to file

Let's walk through a simple use of the system. In this scenario let's say that we have our simulation data and we want to run through the simulation with one camera on a simple circular flythrough path. Spiegel contains a few skeleton .movie files that the user can modify for such needs. For this scenario, the file "one-camera.movie" in the examples directory is sufficient. Load up Spiegel and click on the "Flythrough" tab, as pictured below.

fly-tab.png

Now click the "Load Movie" button under the Movie sub-tab. This will display a file open dialog. Find the movie/examples directory and load one-camera.movie from it. This will load the data from the movie file, including the streams and their keyframes.

Now let's look at what we have to start with. First you will see that the Length and FPS fields now have data in them. The length will need to be changed according to how long your movie is going to run. Let's leave it at 0 for now, since we will know more about the running time later. The FPS will be at a default of 25 frames per second.

Now click the Streams tab to see what streams already exist in the movie:

streams-tab.png

You will notice a drop down menu box labeled Stream. This holds all the streams that are in the movie. For this particular movie, there are 3 streams, a stream called "CommandStream", one called "SimTimeStream", and another called "CameraLocation". Each of these stores data for what their name suggests.

Let's look at the data for the CommandStream?. You will see the CommandStream? has a unique ID, its Name, a Value Type, and Interpolator. The ID is used to uniquely identify this stream. The Name field is a human readable identifier. The Value Type determines the type of data that the stream will contain. Since all Commands are Strings, the CommandStream?'s value type is String. Next is the Interpolator, which determines how the stream's keyframe data will be converted into output data. The Command Interpolator knows how to take the Strings from the stream and generate commands for Spiegel to execute.

Now let's look at the SimTimeStream? stream. This stream is responsible for controlling the flow of time inside the simulation itself. Using this, we can make visualizations that can "freeze" time while the movie (and the camera) to continue. The type must be double and the interpolator is Linear, since time will be advancing linearly between each keyframe.

Finally, let's examine the CameraLocation? stream. This stream produces a value of type vector, since all of its keyframes store the location of the camera in three-dimensional space. The Interpolator is a TCB Interpolator, which calculates a smooth spline curve through the keyframe's data points.

Before we take a look at the Path Editor, let's first look at the Keyframes tab.

key-tab.png

The top portion of the Keyframes tab contains a selection box for the stream to edit, as well as a selection box of all the keyframes in that stream. Next to the keyframes list are four buttons, "add", "delete", "previous", and "next", respectively. Below these are two more tabs, a Time tab and a Value tab. Streams using the TCB interpolator, such as the camera location, also have a TCB tab for adjusting the TCB parameters. The Time tab determines the time in the movie at which this keyframe occurs, while the Value tab determines what value the keyframe contains.

Now let's begin defining a path. The quickest way is to use the built in path editor. The Path Editor can be found under the "Flythrough" tab, between the "Streams" tab and the "Keyframes" tab. The Path Editor's purpose is to provide a visual approach to creating a flythrough path in the system. The keyframes tab allows a user to add points individually by inputting the X, Y, and Z coordinate of each point. This is fine for simple geometric shapes, such as a square, but if the user wants to design a more interesting path, a visual approach is required. Clicking on the Path Editor tab will present you with the following interface:

Once again, you will notice the familiar Streams drop-down box. The Path Editor can only modify streams that store vectors. Select the CameraLocation? stream, and press the "Show Path Editor Window" button. This will open a window that looks like the following:

You will notice a red wireframe cube, along with lines representing the coordinate axes. You can rotate the view by pressing and holding the left mouse button anywhere in the viewport, and dragging it in the direction you would like to rotate it. You can also zoom in and out by clicking and holding the middle mouse button (option+left click for Macs) while dragging. You will notice that there is a large semi-transparent plane intersecting the cube. This is your "selection plane". This is where any mouse clicks in the 3D space will end up. When you want to add a point, a single left mouse click anywhere on the selection plane will cause a point to appear in that location. This allows the 2D mouse to operate in a 3D environment. Let's start making a circular path around the cube. We will start by adding a single point. Click on the selection plane to the right of the cube (in the positive X direction). A small blue sphere will show up. A colored sphere represents each point in space. Let's add a second point and see what happens:

Now a second point has been added, as well as a line. The line represents a path from one point to the next. The white line represents the path through time. It starts at that lowest point in time, and proceeds to the last point in time. The line always connects the dots in order of time (not in order that they were added, if intermediate points are added later). You will also notice that the original sphere changed to red, and the one we added is now blue. The last point on the path is always colored blue, to make it easier to see where an existing line ends. Each point has a time in the movie associated with it. By default the first point will start with time 0.0, and each additional point will add a half second to the previous point. This means that two really close points will cause the camera to move slowly, while two distant points will make the camera move quickly to get there. So if you have 10 points on your path, the last point to have a time value of 4.5. Go ahead and add 8 more points (for a total of 10) so they look like the following:

Now that we have some points, what happens if we want to remove a few? Or perhaps modify a few of them? That is what Edit Mode is for. Press the "Switch to Edit Mode" button on the main window. You will notice a few changes:

Along with these changes, the Selection Plane is now gone. In Edit Mode, the mouse can only select already existing points in the system. Click on a point, and you will notice two things: first, the point becomes green, signifying it as selected, and second, the main window now displays the information of that point.

Selected points can also be deleted by either pressing the delete key, or by pressing the "Delete Selected Points" button in the main window. Multiple points can be selected by holding the Control key while clicking. The same goes for deselecting, hold control to deselect one point at a time when multiple are selected. When a single point is selected you'll notice that the fields for the time, as well as the x, y, and z coordinates become active. This is where you can input more precise points, if you desire.

The Time field allows for the time of points to be adjusted as well. This will cause the line to be redrawn, still in order of time, through all the points. So if you wanted to make the starting point the ending point, simply change its time to the time of the last point plus some amount, then either add another point and make it time 0.0, or change the new starting point to be 0.0. Now that the path is complete, we can determine how long the visualization should run for. Since the last point is at 4.5 seconds, we know our visualization should run for 4.5 seconds. This is the value that should go in the length field in the Movie tab. You can hide the Path Editor Window now, by clicking the "Hide Path Editor Window" button.

Before we change the length, lets set up the Simulation time. Go back to the Keyframes tab, and select the SimTimeStream? stream. This stream has two keyframes already defined, Both have the same data, so we will need to change one. The first one (#0) says that at Time 0.0, the Value of the simulation time is 0.0. This means that the simulation time starts when the actual time starts. We need to change the second one (#1) so that at the end of the visualization, the end of the simulation will have been reached. Since our visualization is now set to run 4.5 seconds, set the Time of keyframe 1 to 4.5 seconds, and set the value to the running length of the simulation (lets say 2 units). This means that in the 4.5 seconds of visualization time, the simulation time will run for 2 simulation time units.

While we're still in the Keyframes tab, take a moment to look at the CameraLocation? stream. In the keyframes list you will now see all of the points (10 of them) that we added using the path editor.

Now lets return to the Movie tab, and set the length. Again, we will set this to 4.5 seconds, due to the time required to traverse the path we created. Once that is completed, go ahead and save your creation to a suitable place by pressing the "Save Movie" button.

The .movie file you just saved is now ready to be used to run through as a visualization. To learn how to do this, move on to RenderingMovies. Or, to learn how to create more complicated movies, proceed to MoviePathEditor.

-- AndrewRader?

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
Main.CreatingASimpleMovie moved from Main.MovieHowto on 12 Jun 2006 - 17:10 by TimPeterson
General Information
Technology
  • Resources

Documentation
Repository
Related Projects
  • GUI Development
  • MovieMaker?
  • GUI
  • 3D Input Devices
  • Fly Through Path

Related Sites

 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback