In a virtual world viewed with a head-mounted display, the user may wish to perform certain actions under the control of a manual input device. The most important of these actions are flying through the world, scaling the world, and grabbing objects. This paper shows how these actions can be precisely specified with Frame-to-frame invariants, and how the code to implement the actions can bc dcrivcd from the invariants by algebraic manipulation.