View Curve Editor

The view curve editor permits the user to create, display, and edit a view curve. Like the animation curves described above, a view curve consists of an ordered list of nodes. While a curve represents a path through space, a view curve represents a path through a viewing state space which includes parameters such as view size, eye position, and eye orientation.

With the view editor, the user can save views in a variety of formats, associate time values to them, and restore them in the MGED display. Although intended primarily for animation work, the view editor can be a useful view-manipulation tool for anyone who uses MGED.

Current V-Curve

The view editor only operates on one view curve at a time; this view curve is called the current view curve, and the name of the current view curve is displayed at the top of the view curve editor. If there is no current view curve when the editor is created, then an empty view curve named view is automatically created.

Clicking on the Current V-Curve: label posts a menu with the following entries:

New V-Curve
Creates a new view curve and makes it current. The user is asked for the name of the new view curve.

Open V-Curve
Makes an existing view curve current. The user selects from a list of existing view curves.

Rename V-Curve
Changes the name of the current view curve as specified by the user.

Copy V-Curve
Creates a copy of the current view curve and makes the copy current. The user is asked to supply a name for the new view curve.

Delete V-Curve
Deletes a view curve selected by the user from a list of existing view curves.
Clicking on the name of the current view curve at the top of the view curve editor brings up the corresponding view curve display window (see below).

View Curve Parameters

The view curve editor can represent the viewing state in one of several possible formats. The format currently being used is displayed next to the Parameters label; clicking on this label posts a menu from which any other format can be selected by the user.

The five viewing state formats are:

Each of these formats consists of two or three view parameters which together uniquely define the viewing state. These underlying view parameters are: In the MGED display editor, the viewing state is represented by a viewing cube centered at center with sides of length size and an orientation given by quat or ypr. The eye point is centered in the "top" face of the viewing cube; the user looks down from the eye point toward the center point. The distance between these points is thus one half the size. For a more complete description of these parameters and the relationships between them, see the viewget manual page.

Each node of a view curve contains a time parameter and the view parameters specified by the current format. When the user changes the current format, all of the nodes of the current curve are converted to the new format.

Most of the parameter combinations contain a size, a position, and an orientation, completely specifying the view state. The only exception is the eye center format. Fixing the eye point and center point leaves one degree of freedom in the view state, which AnimMate removes by selecting a "right-side up" orientation (i.e. an orientation with no twist or roll). If the user tries to add a view state which is not "right-side up" to a view curve in in eye center form, then a "right-side up" viewing state with the same eye and center points is stored instead.

Note that converting a view curve to one of the "size position orientation" formats and back always leaves the view curve unchanged. Converting a view curve to eye center format and back always creates a view curve consisting only of "right-side up" view states.

The different view curve formats are useful because they produce different results when the view curves are interpolated. For example, "center"-based view curves are best when the user wants the viewer's eye to look at a fixed point or keep a particular object in view. "Eye"-based view curves are useful when the path of the eye itself is more important. "Quat"-based view curves avoid interpolation artifacts such as gimbal lock, while "ypr"-based view curves are more intuitive and simpler to interpolate.

Current Node

The next section of the view curve editor displays and controls the current view curve node. Whenever the current view curve is non-empty, one of the nodes is highlighted in the view curve display window as the current node. This is the node which will be affected by move and delete operations and which controls where new nodes are added and inserted, as explained below.

The view curve editor contains a label of the form "Node i of n", where n is the number of nodes in the current curve, and i is the index of the current node. The index is always constrained to lie between 0 and n-1.

The left and right arrow buttons can be used to change the current node index. The small right and left arrows increment and decrement the current node index by one, while the larger arrows increment and decrement in steps of 10.

The entry box next to the Time label displays the time parameter of the current node. The time parameter can be keyboard-edited after clicking on the box with the left mouse button. The new parameter is applied to the view curve when the Return key is pressed.

The checkbutton labeled Apply current node to view determines whether or not the MGED display editor should be updated to reflect the contents of the current view curve node. To visually step through a view curve, the checkbutton should be selected so that the display changes as the user increments the current node index from start to finish. The checkbutton should be deselected in order to change the current node index without disturbing the view in the MGED display. For example, to insert the current MGED view onto the beginning of an existing view curve, the user should deselect the checkbutton, decrement the current node index to 0, and then invoke the INSERT button.

View Curve Editing

The next four buttons in the view curve editor perform the principal editing operations:
ADD
This command adds a new node to the current view curve, inserting it after the current node. The new node then becomes current. The view parameters for the new node are taken from the current view state of the MGED display window. Before activating the button, the user should set the display to the desired view state. If the new node is being added to the end of the current view curve, the new time parameter will be the time parameter of the previous node incremented by the value of the global variable mged_sketch_tinc (The value of this variable is typically 1.0, but it may be set arbitrarily by the user.) If the new node is added between two existing nodes, its time parameter will be the average of the adjacent time parameters.

INSERT
This command adds a new node to the current view curve, inserting it before the current node. The new node then becomes current. The view parameters for the new node are taken from the current view state of the MGED display window. If the new node is being inserted onto the beginning of the current view curve, then the time parameter will be the time parameter of the adjacent node minus the global variable mged_sketch_tinc. Otherwise, the new time parameter will be the average of the time parameters before and after the new node.

MOVE
This command sets the view parameters of the current node to the current viewing state of the MGED display window.

DELETE
This command deletes the current node from the current view curve.

Reading and Writing View Curves

The Read/Write menu has the following options:
Read V-curve From File
A view curve can be created or modified by reading an ASCII file. The file should be a table containing one row for each node of the view curve. There should be a column for time and a column for each view parameter of the view curve. The user is asked which file to read and which view curve to read into. By default, the file is read into the current view curve.

If the number of columns in the file doesn't match the number of parameters in the view curve, an error message is displayed. In this event, the user should convert the view curve to the same view format as the file before proceeding. If the view curve does not yet exist, then AnimMate assumes that it has the default parameters size eye quat. To create a new view curve from a file with another view format, the user should first create an empty view curve and convert it to the appropriate format using the Parameters menu.

Write V-curve to File
The nodes of a view curve are written to a ASCII file. The file has a column for each view parameter, and a row for each node of the view curve. The user specifies the name of the view curve to write and the file to write to. By default, the current view curve is written.

Other Buttons

The Up button raises the parent of the view curve editor to the top of the stacking order, and the Cancel button closes the view curve editor.

View Curve Display Window

The user can view the parameters of a view curve in text format using a view curve display window that looks much like a table editor. The major difference between the two is that the text in the view curve display window cannot be keyboard-edited. This helps ensure that the view curve always has the correct number of columns.

The view curve display window is the mechanism by which AnimMate stores view curve parameters. Using the window manager to close this window destroys the view curve; see the Hide button, below.

The view curve name is displayed at the top of the display window. Immediately below the name is the column bar, which labels the index of each column, and the text display area. The current contents of the view curve appear in the text display area, with one row for each node of the view curve. The row corresponding to the current node is always highlighted.

The menu bar at the bottom of the view curve display window contains the following buttons:

Write
Selected columns of a view curve can be written to a file, curve, or another view curve. The user specifies the name of the file, curve, or view curve to write to, and which columns to write. While a file can accept any number of columns, curves and view curves are picky about the number of columns they accept. A curve can accept either three or four columns; in the latter case, the columns are interpreted as time x y z, and in the former case, columns are interpreted as x y z and the time of each node is set to the node index. The number of columns accepted by a view curve may vary from seven to nine, depending on the combination of view parameters which it stores. If the number of columns in the source view curve is incompatible with the destination, an error message is displayed.

To specify which columns should be written, the following syntax is used. The string all in this context represents all the columns. Comma-separated integers are used to identify individual columns: 0 is the first column and n-1 is the last of n columns. Dashes represent ranges. For example, 2-4 is identical in meaning to 2,3,4; 4-2 is the same as 4,3,2; and 4- represents columns 4 through n-1.

Clone
This button creates a normal table editor containing a copy of the current view curve parameters. This table editor can be used for all of the table editor operations such as keyboard editing, interpolation, column editing, and time estimation. The resulting table can be written back into the view curve. This method of editing helps to ensure that the view curve always has the correct number of columns.

Up
This button raises the view curve editor to the top of the stacking order.

Hide
This button removes the view curve display window from the screen. The display window is redisplayed when the corresponding view curve becomes current, or, if it is already current, when the user clicks on the view curve name displayed next to the Current v-curve label on the view curve editor. The view curve display window must not be closed or killed by the window manager, or the contents of the view curve will be lost.

Next Section: Create Object Script

Previous Section: Table Editor

Index