| V_Sim API - Reference Manual | ||||
|---|---|---|---|---|
When one wants some interactions on the rendering area (either from the mouse or from the keyboard), one should initialise it using openGLInteractiveInit_session(). Then, during the interactive session, several modes have been implemented:
openGLInteractiveBegin_mark(), is a mode where the mouse can select a node and this nodes become highlighted.
openGLInteractiveBegin_move(), the mouse is then used to move picked nodes. Moves are possible in the plane of the screen or constrained along axis of the bounding box.
openGLInteractiveBegin_observe(), in this mode, the mouse is used to change the position of camera, its orientation and its zoom characteristics.
openGLInteractiveBegin_pick(), this mode is the most complex picking mode. It can select atoms up to two references and measure distances and angles.
openGLInteractiveBegin_pickAndObserve(), this mode is a simplified mix of obervation and picking.
The observe mode has two different moving algorithms that can be changed using openGLInteractiveSet_preferedObserveMethod(). The first, called 'constrained' (cf. OPENGL_OBSERVE_CONSTRAINED) corresponds to movements along parallels and meridians. When the mouse is moved along x axis, the camera raotates along a parallel. When the camera is moved along y axis, the camera rotate along a meridian. The top is always pointing to the north pole (in fact, omega is always forced to 0 in this mode). This mode has a 'strange' behavior when the observer is near a pole: moving mouse along x axis make the box rotates on itself. It is normal, because movements on x axis is equivalent to movements on parallel and near the poles, parallel are small circle around the z axis. This can be unnatural in some occasion and the other mode, called 'walker' (see OPENGL_OBSERVE_WALKER) can be used instead of the 'constrained' mode. In the former, the moving is done has if the observer was a walking ant on a sphere : moving the mouse along y axis makes the ant go on or forward ; and x axis movements makes the ant goes on its left or on it right. This is a more natural way to move the box but it has the inconvient that it is hard to return in a given position (omega has never the right value).
typedef enum
{
Key_None,
Key_Page_Up,
Key_Page_Down,
Key_Arrow_Left,
Key_Arrow_Right,
Key_Arrow_Up,
Key_Arrow_Down
} SpecialKeyStroke;
Possible non ascii keys used in SimplifiedEvents.