Interaction with Mouse in OpenGL (Part 1)

Print Friendly, PDF & Email

Cytoscape
Selection Objects (www.3dkingdoms.com)
BioLayout Express 3D, click here to get more details of BioLayoutJava
Interactive Graph Drawing is an open source for drawing interactive graph drawing on the WWW, inspired by Arthur van Hoff’s early GraphLayout Java demonstration applet. He implemented how to select and move nodes on the graph.
VisAnt is an Integrative Visual Analysis Tool for Biological Networks and Pathways. Currently, there is not available source code.


/* Function prototypes */
/*
* Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* current mouse cursor position.  You can pass NULL for either x or y.
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);

With:
/* Used as a mask when testing buttons in buttonstate
Button 1: Left mouse button
Button 2: Middle mouse button
Button 3: Right mouse button
Button 4: Mouse wheel up  (may also be a real button)
Button 5: Mouse wheel down (may also be a real button)
*/
#define SDL_BUTTON(X)  (1 < < ((X)-1))
#define SDL_BUTTON_LEFT  1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)

translation rotation

3 thoughts on “Interaction with Mouse in OpenGL (Part 1)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.