diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-06 18:21:25 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-06 18:21:25 +0000 |
| commit | f9039b2ae21988783feae9b362818e7923e82d14 (patch) | |
| tree | 6d6fe3679d73448758f9794e7d4d4f6b22a4adad /test/fracviewer.h | |
| parent | 67e89232f9ba067825a158734a09e0fa21aacbe3 (diff) | |
Initial revision
git-svn-id: file:///fltk/svn/fltk/trunk@2 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/fracviewer.h')
| -rw-r--r-- | test/fracviewer.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/test/fracviewer.h b/test/fracviewer.h new file mode 100644 index 000000000..d217e9aa6 --- /dev/null +++ b/test/fracviewer.h @@ -0,0 +1,104 @@ +/* + * fracviewer.h [from agviewer.h (version 1.0)] + * + * AGV: a glut viewer. Routines for viewing a 3d scene w/ glut + * + * The two view movement modes are POLAR and FLYING. Both move the eye, NOT + * THE OBJECT. You can never be upside down or twisted (roll) in either mode. + * + * A nice addition would be an examiner type trackball mode where you are + * moving the object and so could see it from any angle. Also less restricted + * flying and polar modes (fly upside down, do rolls, etc.). + * + * Controls for Polar are just left and middle buttons -- for flying it's + * those plus 0-9 number keys and +/- for speed adjustment. + * + * See agv_example.c and agviewer.c for more info. Probably want to make + * a copy of these and then edit for each program. This isn't meant to be + * a library, just something to graft onto your own programs. + * + * I welcome any feedback or improved versions. + * + * Philip Winston - 4/11/95 + * pwinston@hmc.edu + * http://www.cs.hmc.edu/people/pwinston + */ + + + /* + * Call agvInit() with glut's current window set to the window in + * which you want to run the viewer. Right after creating it is fine. It + * will remember that window for possible later use (see below) and + * registers mouse, motion, and keyboard handlers for that window (see below). + * + * allowidle is 1 or 0 depnding on whether you will let AGV install + * and uninstall an idle function. 0 means you will not let it (because + * you will be having your own idle function). In this case it is your + * responsibility to put a statement like: + * + * if (agvMoving) + * agvMove(); + * + * at the end of your idle function, to let AGV update the viewpoint if it + * is moving. + * + * If allowidle is 1 it means AGV will install its own idle which + * will update the viewpoint as needed and send glutPostRedisplay() to the + * window which was current when agvInit() was called. + * + * agvSetIdleAllow changes this value so you can let AGV install its idle + * when your idle isn't installed. + * + */ +void agvInit(int allowidle); +void agvSetAllowIdle(int allowidle); + + + /* + * Set which movement mode you are in. + */ +typedef enum { FLYING, POLAR } MovementType; +void agvSwitchMoveMode(int move); + + /* + * agvViewTransform basically does the appropriate gluLookAt() for the + * current position. So call it in your display on the projection matrix + */ +void agvViewTransform(void); + + /* + * agvMoving will be set by AGV according to whether it needs you to call + * agvMove() at the end of your idle function. You only need these if + * you aren't allowing AGV to do its own idle. + * (Don't change the value of agvMoving) + */ +extern int agvMoving; +void agvMove(void); + + /* + * These are the routines AGV registers to deal with mouse and keyboard input. + * Keyboard input only matters in flying mode, and then only to set speed. + * Mouse input only uses left two buttons in both modes. + * These are all registered with agvInit(), but you could register + * something else which called these, or reregister these as needed + */ +void agvHandleButton(int button, int state, int x, int y); +void agvHandleMotion(int x, int y); +void agvHandleKeys(unsigned char key, int x, int y); + + /* + * Just an extra routine which makes an x-y-z axes (about 10x10x10) + * which is nice for aligning things and debugging. Pass it an available + * displaylist number. + */ +void agvMakeAxesList(int displaylist); + + + + + + + + + + |
