Interactive 3D Transformations
To create truly interactive object graphics, you must allow the user to transform the position or orientation of objects using the mouse. One way to do this is to provide a virtual trackball that lets the user manipulate objects interactively on the screen.
Note
The iTools provide extensive interactivity for all types of object data displayed in an iTool. This interactivity is automatically available when suitable data is displayed in an iTool. See the iTool User's Guide for complete details.
The procedure file trackball__define.pro, found in the lib directory of the IDL distribution, contains the object definition procedure for a virtual trackball object. This trackball object is used in several of the examples presented in this volume, and is also used by other example and demonstration code included with IDL. The trackball object has three methods: Init, Update, and Reset. These methods allow you to retrieve mouse movement events and alter your model transformations accordingly.
The trackball object behaves as if there were an invisible trackball, centered at a position you specify, overlaid on a draw widget. The widget application's event handler uses the widget event information to update both the trackball's state and the model transformation of the objects displayed in the draw widget's window object. When the user clicks and drags in the draw widget, objects in the draw widget rotate as if the user were manipulating them with a physical trackball.
See "TrackBall" (IDL Reference Guide) for details on creating and using trackball objects. Several of the other example files located in the examples/doc/objects subdirectory of the IDL distribution include trackball objects, and may be studied for further insight into the mechanics of transforming object hierarchies based on user input.
Note
The XOBJVIEW procedure is a utility used to quickly and easily view and manipulate IDL Object Graphics on screen. Pre-built functionality allows you to select, rotate, pan and zoom objects contained within the model(s) passed to the procedure. See "XOBJVIEW" (IDL Reference Guide) for details.