Using the UFO Camera Manipulator


Roman Forum Model - Courtesy of UCLA

Introduction

The OpenSceneGraph UFO camera manipulator is used with the standard viewer (osgviewer), and is driven purely from the keyboard. It provides the user with steadier and more precise control over the movement of the eye point through a scene than the mouse-driven manipulators, and is more suitable for applications like architectural walk-throughs, or scene fly-throughs that move slowly and deliberately.

Named UFO, it provides linear movement in all three axes (forward/backward, up/down, sideways), and rotational movement around pitch and yaw. UFO is not intended for "flight" simulation, so there is no rotational movement around the roll axes. Use UFO when you want the eye point to remain level horizontally.

Quick Reference

Key
or Key Combination
Effect
Up Arrow Acceleration forward
Down Arrow Acceleration backward
Left Arrow Yaw direction of travel to left
Right Arrow Yaw direction of travel to right
Shift / Up Arrow Accelerate up
Shift / Down Arrow Accelerate down
Shift / Left Arrow Accelerate sideways left
Shift / Right Arrow Accelerate sideways right
Ctrl / Up Arrow Rotate view (but not direction of travel) up
Ctrl / Down Arrow Rotate view (but not direction of travel) down
Ctrl / Left Arrow Rotate view (but not direction of travel) left
Ctrl / Right Arrow Rotate view (but not direction of travel) right
Space Bar Brake - decelerate all linear and rotational movement
Shift/Space Bar Stop all linear and rotational movement
Ctrl / Return Straighten rotated view towards direction of travel
Shift / H ('H') Go to "home" position

Tutorial

This is a brief tutorial with a little more detailed information about the UFO behavior. It provides the reader with the opportunity to practice using the manipulator until it becomes "second nature".

The Basics

Basic functionality is not unlike driving a car. Start osgviewer in your favorite database, and press the '5' key, to place you in the UFO manipulator. When the manipulator starts out, it tries to place you on the ground in the middle of the database. There is no foolproof way to guess where this should be exactly, but in essence, it places the eye point where a vertical line segment intersects the center of the database, closest to zero altitude, at a set altitude over the ground. This might, likely, put you inside a building. Other applications may wish to set the home position directly of the manipulator before start-up.

Tap the UpArrow key. Forward movement should begin and stay at a steady speed, until the UpArrow key is tapped again. Holding down the UpArrow key, the eye point will accelerate forward. To decelerate, tap, or hold down the DownArrow key. The DownArrow key may also be used to accelerate backwards.

Holding down the SpaceBar will slow forward or backward movement like pressing on the brakes of a car. If it is necessary to stop instantly, press the Shift key with the SpaceBar.

Accelerate forward again, by pressing on the UpArrow key. Once a satisfactory speed has been attained, release the UpArrow key and tap the RightArrow or LeftArrow key. Each top on the LeftArrow or RightArrow keys results in an increment (or decrement) of turn radius in that direction (RightArrow rotates right, LeftArrow rotates left). This is not unlike turning the steering wheel of a car, except for the fact that the turn radius remains after the LeftArrow or RightArrow key has been released. It is necessary, therefore, to tap on both the LeftArrow and the RightArrow keys, while navigating through a scene to make adjustments in direction of travel, much like making adjustments with the steering wheel of a car.

Vertical and Horizontal Movement

After becoming familiar with the basic functionality, stop all movement (with continuously pressing the SpaceBar, or pressing Shift/SpaceBar) and become familiar with movement in the vertical and horizontal directions. Press the Shift key and tap the UpArrow key. The eye point will begin moving directly upwards, and will accelerate upwards as long as the UpArrow key is held down. Note that releasing the UpArrow key, but holding down the Shift key will keep the eye point moving directly upward at a steady rate. Releasing the Shift key will then decelerate upward travel until it stops.

This behavior is the same for the Shift/DownArrow key combination, the Shift/LeftArrow key combination and the Shift/Right arrow key combination, accelerating the eye point down, left and right respectively, holding a steady rate when the Arrow key is released, and decelerating linear travel when the Shift key is released.

After practicing and becoming familiar with this mode of operation, combine these modes with forward travel. Begin forward movement by tapping on the UpArrow key. After a satisfactory speed is attained, press the Shift/UpArrow key combination until a satisfactory rate of ascent is established, and then release the UpArrow key. Maintain the ascent rate until a satisfactory altitude is approached, then release the Shift key. Practice this with the Shift/DownArrow, Shift/LeftArrow and Shift/RightArrow combinations as well.

Rotating the View

After becoming familiar with Basic and Vertical/Horizontal movement, begin again with all movement stopped. Press the Ctrl key/LeftArrow key combination. The direction of viewing will rotate left. The key combination has the same behavior as with the Vertical/Horizontal key combinations, in that it will accelerate when the Arrow key is pressed, remain at a steady rate of rotation when the Ctrl key is pressed, but the Arrow key is released, then decelerate the rotation of the view direction when the Ctrl key is released. Again, this will work for the Ctrl/RightArrow key combination, Ctrl/UpArrow key combination and Ctrl/DownArrow key combination, accelerating the rotation of the view direction right, up, and down respectively, maintaining a steady rate of rotation when the Arrow key is released, and decelerating the rate of rotation when the Ctrl key is released.

It should be noted that the Ctrl/Arrow key combinations rotate the view direction and not the direction of travel. Test this by rotating the view until it is 90 degrees to one side or the other, then tapping the UpArrow key (no Shift, no Ctrl). Note that the direction of travel is not in the viewing direction.

The primary purpose for the Ctrl/Arrow key combinations is for looking around when all movement is stopped. However, it may also be used, with some practice to "look around" while in motion, as long as the user can keep track of the differences between direction of travel and direction of view.

A useful key combination should be mentioned here. Ctrl/Return will align the view direction with the direction of travel. Like most controls in the UFO manipulator, it effects its changes over time, so it is necessary to hold down the Ctrl/Return key combination until the view is directly in line with the direction of travel. Ctrl/Shift/Return will instantly lock the view direction to the direction of travel.

Going Home with 'H'

One last item should be noted, which is a difference in the behavior of the UFO manipulator to other OpenSceneGraph manipulators. Each manipulator has a "Home" position, or a location in the database the manipulator will return to when an event occurs to send it home. On most manipulators, that event occurs by pressing the SpaceBar. Since the SpaceBar provides a nice large "brake" for the UFO manipulator, the 'H' key is used for going home. ('h' - lower case gets the 'help' page, so 'H' - upper case is used instead).

Final

Please report any problems or functionality that doesn't conform to this document to the osg-users list (http://www.openscenegraph.net/mailman/listinfo/osg-users).