Saving Graphics Views

The current graphics view can be saved and restored using the following commands:

View Save Position <n>

View Restore Position <n>

When you save a view, you save the camera settings in effect at the time the command is issued. When you restore the view, the camera is returned to the saved position, orientation, and field of view.

If autocenter is on at the time you save the view, then restoring the view will automatically adjust the camera settings to center on the entire model and fit the entire model on the screen, a lot like "zoom reset." You turn autocenter on by typing "graphics autocenter on."

Example of how to save a top view:

at 0

from 0 1 0

up 1 0

graphics autocenter on

view save position 3

Use this command to restore that view:

view restore position 3

The view will then be looking down the y-axis, with the x-axis to the top and the z-axis to the right. The model will be centered in the view and zoomed so that everything just fits into the graphics window. This is true even if the model is not centered on the origin.

If autocenter is off when the "view save" command is issued, the camera is not adjusted to fit the scene into the graphics window. Instead, it is placed exactly where it was at the time the "save" command was issued.

Note that many graphics commands, such as "at", "from", and "up", do not change what appears in the graphics window until a "display" command is issued. They do, however, take immediate effect internally, and they do affect what is saved by the "view save" command.

In the command line version of Trelis, you can save a view by holding down the shift key and pressing one of the function keys (F1-F12). Each function key corresponds to a different saved view. A total of 12 views can be saved. A view can be restored at a later time by pressing the appropriate function key WITHOUT holding down the shift key.

It may be useful to save views in your Trelis file so that they are available every time you run Trelis. Use Trelis to save front, top, and side views in positions 1, 2, and 3. If views are saved in your Trelis file, it is convenient to add a "view reset" command after the views have been saved. Then the graphics will initially appear as they would if the view commands had not been included in your Trelis file.